Skip to content

Commit

Permalink
Doc example fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Jun 28, 2023
1 parent 1ca9a40 commit 23ce101
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions doc/source/code-examples/advancedexamples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1917,9 +1917,9 @@ which can be called on a state or density matrix. For example

circuit = Circuit(4)
circuit.add(gates.H(i) for i in range(4))
c.add(gates.CNOT(0, 1))
c.add(gates.CNOT(1, 2))
c.add(gates.CNOT(2, 3))
circuit.add(gates.CNOT(0, 1))
circuit.add(gates.CNOT(1, 2))
circuit.add(gates.CNOT(2, 3))

hamiltonian = XXZ(4)

Expand Down Expand Up @@ -1947,9 +1947,10 @@ to allow calculation of expectation values directly from such samples:

circuit = Circuit(4)
circuit.add(gates.H(i) for i in range(4))
c.add(gates.CNOT(0, 1))
c.add(gates.CNOT(1, 2))
c.add(gates.CNOT(2, 3))
circuit.add(gates.CNOT(0, 1))
circuit.add(gates.CNOT(1, 2))
circuit.add(gates.CNOT(2, 3))
circuit.add(gates.M(*range(4)))
hamiltonian = Z(4)

Expand Down

0 comments on commit 23ce101

Please sign in to comment.