The fixed angle conjecture for the quantum approximate optimization algorithm onregular MaxCut graphs
The universal angles for MaxCut on regular graphs QAOA with guaranteed performance are located in angles_regular_graphs.json
connectivity (str):
p (str):
gamma: list
beta: list
AR: float # The approximation ratio guaranteed by the angles
def get_angles(p: int, conn: int) -> tuple:
try:
data_p = data[str(conn)][str(p)]
gamma, beta = data_p['gamma'], data_p['beta']
return gamma, beta
except KeyError:
print('Angles not found!')
The general approach is to have the data separate from the presentation, à-la MVC pattern.
data/*.(nc|json|npy)
- data filesdata/generators/
- scripts that generate the dataplots/*.ipynb
- scripts that generate figuresplots/pdf/
- pdf output from figure generators
You'll need these to understand and run the code
- QTensor - tensor network simulator with focus on MaxCut
- Cartesian Explorer - a handy tool to map multi-dimensional data
- xarray - used to store datasets with their coordinates in netcdf format
- Gurobi and gurobipy - classical optimization of combinatorial problems.
See instructions on the official site, the general steps are the following:
- Register at the website gurobi.com
- Unpack an archive
- Run licensing code (included in data/generators/*)