From 23ce1011701d05ca93f94fe5980ea5b5103c0622 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Wed, 28 Jun 2023 08:51:00 +0300 Subject: [PATCH] Doc example fixes --- doc/source/code-examples/advancedexamples.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/source/code-examples/advancedexamples.rst b/doc/source/code-examples/advancedexamples.rst index c066e32ebd..81c712f910 100644 --- a/doc/source/code-examples/advancedexamples.rst +++ b/doc/source/code-examples/advancedexamples.rst @@ -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) @@ -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)