@@ -171,26 +171,37 @@ Assuming all-to-all connectivity of qubits, one can minimize the depth of the ci
171171
172172Components can be freely composed ("lego style") to build more complex circuits without needing to configure qubit counts manually.
173173
174- For example, a Grover mixer over 3 independent Dicke-2 sub-registers can be assembled like this:
174+ For example, a Grover mixer over 3 independent Dicke sub-registers (each with 4 qubits, Hamming weight k=2) can be assembled like this:
175175
176176 from qaoa import initialstates, mixers
177177
178- dicke = initialstates.Dicke(2) # Dicke state with k=2 excitations
179- grover = mixers.Grover(dicke) # Grover mixer over the Dicke feasible space
180- tensor = initialstates.Tensor(grover, 3) # 3 independent copies (6 qubits total)
178+ dicke = initialstates.Dicke(2) # Dicke state with k=2 excitations
179+ dicke.setNumQubits(4) # 4-qubit register per block
180+ grover = mixers.Grover(dicke) # Grover mixer over the Dicke feasible space
181+ tensor = initialstates.Tensor(grover, 3) # 3 independent copies (12 qubits total)
181182
182183 tensor.create_circuit()
183184 tensor.circuit.draw('mpl')
184185
185- ` Dicke(k) ` automatically sets ` N_qubits = k ` (the minimum needed register), and
186- ` Grover ` inherits that qubit count from its sub-circuit, so no explicit
187- ` setNumQubits ` call is required.
186+ ` Grover ` inherits the qubit count from its sub-circuit, so no extra ` setNumQubits `
187+ call is needed for the mixer itself.
188188
189- ![ Lego circuit] ( images/lego_circuit.png " Lego circuit: three Grover blocks on 6 qubits ")
189+ ![ Lego circuit] ( images/lego_circuit.png " Lego circuit: three Grover blocks on 12 qubits ")
190190
191191Each sub-circuit is shown as a labelled block in the drawing so the "lego" structure
192192is immediately visible.
193193
194+ To inspect the internal structure of a single Grover block, draw it directly:
195+
196+ grover.create_circuit()
197+ grover.circuit.draw('mpl')
198+
199+ ![ Grover circuit] ( images/grover_circuit.png " Grover mixer: Dicke† – X^n – C^{n-1}Phase – X^n – Dicke ")
200+
201+ The Grover mixer is constructed as U_S† X^n C^{n-1}P X^n U_S, where the Dicke
202+ state-preparation circuit U_S and its inverse are each shown as a single labelled
203+ box (` Dicke† ` / ` Dicke ` ).
204+
194205### Annotating circuits
195206
196207Every component (initial state or mixer) carries a ` label ` attribute that is used as
0 commit comments