qat.purr.backends.qiskit_simulator module

class QiskitBuilder(hardware_model, qubit_count, instructions=None)

Bases: InstructionBuilder

Builder around QASM circuits.

ECR(control, target)
R(axis, target, radii=None)
X(target, radii=3.141592653589793)
Y(target, radii=3.141592653589793)
Z(target, radii=3.141592653589793)
cR(axis, controllers, target, theta)
ccnot(cone, ctwo, target_qubit)
clear()

Resets builder internal state for building a new set of instructions.

cnot(control, target_qubit)
delay(target, time)
had(qubit)
measure(target, *args, **kwargs)
Return type:

InstructionBuilder

merge_builder(other_builder)

overloaded merge_builder Ensure that circuits are copied too As well as the rest of the base merging operations.

repeat(repeat_value=None, repetition_period=None)
reset(qubits)
swap(target, destination)
class QiskitBuilderWrapper(builder)

Bases: object

A wrapped around the Qiskit builder to smoothly integrate into the pipeline API.

A mismatch in the API between the QuantumExecutionEngine and QiskitEngine means that we can’t easily implement Qiskit into pipelines: this is a little “hack” to make the API match.

property instructions
class QiskitEngine(hardware_model=None)

Bases: InstructionExecutionEngine

execute(builder)

Execute a circuit using Qiskit’s AerSimulator as a backend. Options for the simulator can be provided using qatconfig.SIMULATION.QISKIT.

For more information, see: https://docs.quantum.ibm.com/api/qiskit/0.37/qiskit.providers.aer.AerSimulator

optimize(instructions)
Return type:

List[Instruction]

run_calibrations(qubits_to_calibrate=None)
validate(instructions)
class QiskitHardwareModel(qubit_count, noise_model=None, strict_placement=True)

Bases: QuantumHardwareModel

create_builder()
Return type:

InstructionBuilder

create_engine()
Return type:

InstructionExecutionEngine

create_runtime(existing_engine=None)
class QiskitRuntime(execution_engine, metrics=None)

Bases: QuantumRuntime

execute(builder, results_format=None, repeats=None, error_mitigation=None)

Execute a circuit using Qiskit’s AerSimulator as a backend. Options for the simulator can be provided using qatconfig.SIMULATION.QISKIT.

For more information, see: https://docs.quantum.ibm.com/api/qiskit/0.37/qiskit.providers.aer.AerSimulator

get_cl2qu_index_mapping(instructions)
get_default_qiskit_hardware(qubit_count=20, noise_model=None, strict_placement=True, connectivity=None)

Creates a hardware model compatible with the Qiskit simulator.

If strict_placement=True, circuits can only be executed when circuit intructions act on adjacent qubits in the coupling map.

Return type:

QiskitHardwareModel

verify_placement(coupling_map, circuit)

Check that the circuit can be directly mapped according to the wire map defined by the coupling map

Raises if placement cannot happen without swaps