qat.purr.integrations.qiskit module
- class QatBackend(hardware=None, comp_config=None, **fields)
Bases:
BasicSimulator
Basic qiskit backend built to run QASM on our own target machines.
- 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.
- Args:
- provider: An optional backwards reference to the provider object that the backend
is from.
target: An optional target to configure the simulator. fields: kwargs for the values to use to override the default
options.
- Raises:
- AttributeError: If a field is specified that’s outside the backend’s
options.
- run(run_input, **run_options)
Run on the backend.
- Args:
- run_input (QuantumCircuit or list): the QuantumCircuit (or list
of QuantumCircuit objects) to run
run_options (kwargs): additional runtime backend options
- Returns:
BasicProviderJob: derived from BaseJob
- Additional Information:
kwarg options specified in
run_options
will temporarily override any set options of the same name for the current run. These may include:“initial_statevector”: vector-like. The “initial_statevector” option specifies a custom initial statevector to be used instead of the all-zero state. The size of this vector must correspond to the number of qubits in the
run_input
argument.“seed_simulator”: int. This is the internal seed for sample generation.
“shots”: int. Number of shots used in the simulation.
“memory”: bool. If True, the result will contain the results of every individual shot simulation.
Example:
backend.run( circuit_2q, initial_statevector = np.array([1, 0, 0, 1j]) / math.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.