Skip to content

Commit

Permalink
Remove usage of deprecated QuantumCircuit.cnot. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
airwoodix authored Oct 23, 2023
1 parent 77a5eda commit f315623
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Basic quantum circuit execution follows the regular Qiskit workflow. A quantum c

circuit = qiskit.QuantumCircuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.cx(0, 1)
circuit.measure_all()

.. warning:: AQT backends currently require a single projective measurement as last operation in a circuit. The hardware implementation always targets all the qubits in the quantum register, even if the circuit defines a partial measurement.
Expand Down Expand Up @@ -200,7 +200,7 @@ In this Bell state, the expectation value of the the :math:`\sigma_z\otimes\sigm

bell_circuit = qiskit.QuantumCircuit(2)
bell_circuit.h(0)
bell_circuit.cnot(0, 1)
bell_circuit.cx(0, 1)

observable = SparsePauliOp.from_list([("ZZ", 1)])
result = estimator.run(bell_circuit, observable).result()
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Define a circuit that generates 2-qubit Bell state and sample it on a simulator
# Define a circuit.
circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.cx(0, 1)
circuit.measure_all()

# Select an execution backend.
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# Define a circuit
circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.cx(0, 1)
circuit.measure_all()

# Select an execution backend
Expand Down
2 changes: 1 addition & 1 deletion test/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def test_offline_simulator_detects_invalid_circuits(
"""
qc = QuantumCircuit(2)
qc.h(0)
qc.cnot(0, 1)
qc.cx(0, 1)
qc.measure_all()

with pytest.raises(ValueError, match="^Operation 'h' not in basis gate set"):
Expand Down

0 comments on commit f315623

Please sign in to comment.