Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API docs for QuantumCircuit methods #1753

Merged
merged 4 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/apidocs/aer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Qiskit Aer API Reference
aer_pulse
aer_utils
aer_quantum_info
circuit
parallel
50 changes: 50 additions & 0 deletions docs/apidocs/circuit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. _circuit:

Additional circuit methods
==========================

.. currentmodule:: qiskit.circuit

On import, Aer adds several simulation-specific methods to :class:`~qiskit.circuit.QuantumCircuit` for convenience.
These methods are not available until Aer is imported (``import qiskit_aer``).

Setting a custom simulator state
--------------------------------

The set instructions can also be added to circuits by using the
following ``QuantumCircuit`` methods which are patched when importing Aer.

.. automethod:: QuantumCircuit.set_density_matrix
.. automethod:: QuantumCircuit.set_stabilizer
.. automethod:: QuantumCircuit.set_unitary
.. automethod:: QuantumCircuit.set_superop
.. automethod:: QuantumCircuit.set_matrix_product_state

Saving Simulator Data
--------------------------------

The save instructions can also be added to circuits by using the
following ``QuantumCircuit`` methods which are patched when importing Aer.

.. note ::
Each save method has a default label for accessing from the
circuit result data, however duplicate labels in results will result
in an exception being raised. If you use more than 1 instance of a
specific save instruction you must set a custom label for the
additional instructions.

.. automethod:: QuantumCircuit.save_amplitudes
.. automethod:: QuantumCircuit.save_amplitudes_squared
.. automethod:: QuantumCircuit.save_clifford
.. automethod:: QuantumCircuit.save_density_matrix
.. automethod:: QuantumCircuit.save_expectation_value
.. automethod:: QuantumCircuit.save_expectation_value_variance
.. automethod:: QuantumCircuit.save_matrix_product_state
.. automethod:: QuantumCircuit.save_probabilities
.. automethod:: QuantumCircuit.save_probabilities_dict
.. automethod:: QuantumCircuit.save_stabilizer
.. automethod:: QuantumCircuit.save_state
.. automethod:: QuantumCircuit.save_statevector
.. automethod:: QuantumCircuit.save_statevector_dict
.. automethod:: QuantumCircuit.save_superop
.. automethod:: QuantumCircuit.save_unitary