qutip_qip.qiskit

Simulation of qiskit circuits on Gate and Pulse level in qutip_qip.

Classes

QiskitSimulatorBase(name, description, ...)

The base class for qutip_qip based qiskit backends.

QiskitCircuitSimulator([num_qubits, ...])

qiskit backend dealing with operator-level circuit simulation using qutip_qip's CircuitSimulator.

QiskitPulseSimulator(processor[, ...])

qiskit backend dealing with pulse-level simulation.

Job(backend, job_id, circuit)

Stores information about an ongoing job.

class qutip_qip.qiskit.Job(backend: Backend, job_id: str, circuit: list[QuantumCircuit])[source]

Bases: JobV1

Stores information about an ongoing job.

Parameters:
backendQiskitCircuitSimulator

The backend used to simulate a circuit in the job.

job_idstr

Unique ID identifying a job.

resultqiskit.result.Result

The result of a simulation run.

cancel()[source]

Attempt to cancel the job.

result() Result[source]

Return the job’s result

status() JobStatus[source]

Returns job status

submit()[source]

Submit the job to the backend for execution.

class qutip_qip.qiskit.QiskitCircuitSimulator(num_qubits: int = 10, basis_gates: list[str] = ['PHASEGATE', 'X', 'Y', 'Z', 'H', 'S', 'T', 'RX', 'RY', 'RZ', 'SWAP', 'QASMU', 'CX', 'CY', 'CZ', 'CRX', 'CRY', 'CRZ', 'CPHASE'], max_shots: int = 1000000.0, max_circuits: int = 1, name: str = 'circuit_simulator', description: str = 'A qutip-qip based operator-level circuit simulator.', version: str = '0.1')[source]

Bases: QiskitSimulatorBase

qiskit backend dealing with operator-level circuit simulation using qutip_qip’s CircuitSimulator.

Parameters:
num_qubitsint, Optional

Number of qubits supported by the backend circuit simulator. Defaults to 10 qubits.

basis_gateslist[str], Optional

QuTiP Basis Gates supported by the backend circuit simulator. Defaults to [PHASEGATE, X, Y, Z, RX, RY, RZ, Hadamard, S, T, SWAP, QASMU, CX, CY, CZ, CRX, CRY, CRZ, CPHASE]

max_shotsint, Optional

Maximum number of sampling shots supported by the circuit simulator. Defaults to 1e6

max_circuitsint, Optional

Maximum number of circuits which can be passed to the backend circuit simulator. in a single job. Defaults to 1.

namestr, Optional

Name of the backend circuit simulator.

descriptionstr, Optional

Description of the backend circuit simulator.

versionfloat, Optional

Backend circuit simulator version

Notes

Inherits all attributes and methods from QiskitSimulatorBase.

property meas_map: list[list[int]]

Simulator allows measuring any qubit independently

class qutip_qip.qiskit.QiskitPulseSimulator(processor: Processor, num_qubits: int = 10, basis_gates: list[str] = ['PHASEGATE', 'X', 'Y', 'Z', 'H', 'S', 'T', 'RX', 'RY', 'RZ', 'SWAP', 'QASMU', 'CX', 'CY', 'CZ', 'CRX', 'CRY', 'CRZ', 'CPHASE'], max_shots: int = 1000000.0, max_circuits: int = 1, name: str = 'pulse_simulator', description: str = 'A qutip-qip based pulse-level             simulator based on the open system solver.', version: str = '0.1')[source]

Bases: QiskitSimulatorBase

qiskit backend dealing with pulse-level simulation.

Parameters:
processorProcessor

The processor model to be used for simulation. An instance of the required Processor object is to be provided after initialising it with the required parameters.

num_qubitsint, Optional

num_qubits for the Pulse Simulator Backend. Defaults to 10 qubits.

basis_gateslist[str], Optional

The basis gates names in QuTip. Defaults to (PHASEGATE, X, Y, Z, RX, RY, RZ, Hadamard, S, T, SWAP, QASMU, CX, CY, CZ, CRX, CRY, CRZ, CPHASE)

max_shotsint, Optional

Maximum number of shots the Backend support while sampling.

max_circuitsint, Optional

The maximum number of circuits that can be run in a single job.

namestr, Optional

Name of the Pulse Simulator Backend

descriptionstr, Optional

Description of the Pulse Simulator Backend

versionstr, Optional

Version of Pulse Simulator Backend

Attributes:
processorProcessor

The processor model to be used for simulation.

class qutip_qip.qiskit.QiskitSimulatorBase(name: str, description: str, version: str, num_qubits: int, basis_gates: list[str], max_shots: int, max_circuits: int)[source]

Bases: BackendV2

The base class for qutip_qip based qiskit backends. This class must always be inherited, never instantiated as the implementation of abstract method _run_job is left to the child class.

Parameters:
namestr

Backend name.

descriptionstr

Backend description.

versionfloat

Backend version

num_qubitsint

Number of qubits supported by the backend.

basis_gateslist[str]

QuTiP Basis Gates supported by the backend.

max_shotsint

Maximum number of sampling shots supported by the backend. Defaults to 1e6

max_circuitsint

Maximum number of circuits which can be passed to the backend in a single job. Defaults to 1.

Notes

Inherits all attributes from BackendV2.

property max_circuits: int | None

The maximum number of circuits that can be run in a single job.

If there is no limit this will return None.

property max_shots: int

The maximum number of shots that can be used by the sampler.

run(run_input: QuantumCircuit | list[QuantumCircuit], **run_options) Job[source]

Simulates a circuit on the required backend.

Parameters:
run_inputlist[qiskit.circuit.QuantumCircuit]

List of qiskit circuits to be simulated.

run_optionsdict[str, Any], Optional

Additional run options for the backend. Valid options are shots - Number of times to sample the results.

Returns:
Job

Job object that stores results and execution data.

property target: Target

A qiskit.transpiler.Target object for the backend.

Return type:

Target