Skip to content

Commit

Permalink
QuantumCircuit: Inform user when Aer backend is not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jul 12, 2022
1 parent 925d8cb commit 27d934f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4762,6 +4762,12 @@ def qubit_stop_time(self, *qubits: Union[Qubit, int]) -> float:

return 0 # If there are no instructions over bits

def save_statevector(self, label="statevector", pershot=False, conditional=False):
raise NotImplementedError(
"To use this method, you must first initialize the Aer simulator backend, e.g. "
'backend = Aer.get_backend("aer_simulator")'
)


def _circuit_from_qasm(qasm: Qasm) -> "QuantumCircuit":
# pylint: disable=cyclic-import
Expand Down

0 comments on commit 27d934f

Please sign in to comment.