You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -148,6 +149,10 @@ This library already contains several standard implementations.
148
149
149
150
It is **very easy to extend this list** by implementing the abstract methods of the base classes above. Feel free to fork the repo and open a pull request!
150
151
152
+
See [examples/MaxCut/OverlapInitialState.ipynb](examples/MaxCut/OverlapInitialState.ipynb) for a study of how the overlap between the initial state and the X-mixer ground state affects QAOA performance at various circuit depths.
153
+
154
+
See [examples/MaxCut/KCutExamples.ipynb](examples/MaxCut/KCutExamples.ipynb) for worked examples of Max k-cut using both one-hot and binary encodings.
155
+
151
156
For example, to set up QAOA for MaxCut using the X-mixer and $|+\rangle^{\otimes n}$ as the initial state:
152
157
153
158
```python
@@ -266,6 +271,22 @@ Implement `get_num_parameters()` in a custom component to enable multi-angle sup
266
271
267
272
---
268
273
274
+
## Fixing One Node to Reduce Circuit Size
275
+
276
+
The MaxCut (and Max k-cut) problem exhibits a **flip symmetry**: swapping all partition labels yields an equally valid solution. This symmetry allows one node to be fixed to a specific partition, removing it from the circuit entirely.
277
+
278
+
The node selected for fixing is always the **highest-degree node**. Fixing this node eliminates CZ gates equal to its degree — the maximum possible reduction for a single fixed node.
279
+
280
+
Enable this via the `fix_one_node` flag on any graph problem:
281
+
282
+
```python
283
+
problem = problems.MaxCut(G, fix_one_node=True)
284
+
```
285
+
286
+
See [examples/MaxCut/FixOneQubit.ipynb](examples/MaxCut/FixOneQubit.ipynb) for a worked example showing the circuit-size reduction and that the approximation quality is preserved.
287
+
288
+
---
289
+
269
290
## Minimizing Depth of Phase Separating Operator
270
291
271
292
Assuming all-to-all connectivity of qubits, one can minimize the circuit depth of the phase separating operator by solving the minimum edge colouring problem. This is implemented in [GraphHandler](qaoa/util/graphutils.py) and is invoked automatically. An [example](examples/MaxCut/MinimalDepth.ipynb) output is shown below:
Copy file name to clipboardExpand all lines: qaoa/problems/graph_problem.py
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,9 @@ class GraphProblem(Problem):
15
15
Attributes:
16
16
G: The graph to be used in the problem.
17
17
N_qubits_per_node (int): Number of qubits per node.
18
-
fix_one_node (bool): If True, fixes the last node to "color1".
18
+
fix_one_node (bool): If True, fixes the highest-degree node to "color1",
19
+
reducing circuit size. The highest-degree node is chosen to maximize the
20
+
number of entangling gates eliminated.
19
21
20
22
Methods:
21
23
create_edge_circuit(theta): Abstract method to create circuit for an edge
@@ -30,17 +32,19 @@ def __init__(
30
32
self,
31
33
G,
32
34
N_qubits_per_node=1,
33
-
fix_one_node: bool=False, # this fixes the last node to color 1, i.e., one qubit gets removed
35
+
fix_one_node: bool=False, # fixes the highest-degree node to color 1, removing it from the circuit and eliminating entangling gates proportional to its degree
34
36
) ->None:
35
37
"""
36
38
Args:
37
39
G: The graph to be used in the problem.
38
40
N_qubits_per_node (int): Number of qubits per node.
39
-
fix_one_node (bool): If True, fixes the last node to "color1".
41
+
fix_one_node (bool): If True, fixes the highest-degree node to "color1", reducing
42
+
the circuit size. The highest-degree node is chosen to maximize the number of
43
+
entangling gates eliminated (proportional to the degree of the fixed node).
40
44
"""
41
45
super().__init__()
42
46
43
-
# fixes the last node to "color1"
47
+
# fixes the highest-degree node (node n-1 after relabeling) to "color1"
0 commit comments