qat.purr.integrations.qiskit module
- class QatBackend(hardware=None, comp_config=None, **fields)
Bases:
QasmSimulatorPy
Basic qiskit backend built to run QASM on our own backends.
- TODO: Expand this to become a proper back-end, as I don’t believe we need to inherit
off the QASM simulator as it stands.
Initialize a backend class
- Args:
- configuration (BackendConfiguration): A backend configuration
object for the backend object.
- provider (qiskit.providers.Provider): Optionally, the provider
object that this Backend comes from.
- fields: kwargs for the values to use to override the default
options.
- Raises:
AttributeError: if input field not a valid options
In addition to the public abstract methods, subclasses should also implement the following private methods:
- classmethod _default_options()
Return the default options
This method will return a
qiskit.providers.Options
subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.- Returns:
- qiskit.providers.Options: A options object with
default values set
- run(qobj, **backend_options)
Run on the backend.
- Args:
run_input (QuantumCircuit or list): payload of the experiment backend_options (dict): backend options
- Returns:
BasicAerJob: derived from BaseJob
- Additional Information:
- backend_options: Is a dict of options for the backend. It may contain
“initial_statevector”: vector_like
The “initial_statevector” option specifies a custom initial initial statevector for the simulator to be used instead of the all zero state. This size of this vector must be correct for the number of qubits in
run_input
parameter.Example:
backend_options = { "initial_statevector": np.array([1, 0, 0, 1j]) / np.sqrt(2), }
- run_qasm(qasm_str)
Runs the passed-in QASM string against the QASM state simulator.
- run_qasm_circuit(circuit)
- run_qasm_from_file(qasm_file)
Runs the passed-in QASM file against the QASM state simulator.