cunqa.qjob.QJob

class cunqa.qjob.QJob(qpu, circ, transpile, initial_layout=None, opt_level=1, **run_parameters)

Class to handle jobs sent to the simulator.

__init__(qpu, circ, transpile, initial_layout=None, opt_level=1, **run_parameters)

Initializes the QJob class.

It is important to note that if transpilation is set False, we asume user has already done the transpilation, otherwise some errors during the simulation can occur, for example if the QPU has a noise model with error associated to specific gates, if the circuit is not transpiled errors might not appear.

If transpile is False and initial_layout is provided, it will be ignored, as well as opt_level.

Possible instructions to add as **run_parameters can be: shots, method, parameter_binds, meas_level, …

Args:

QPU (<class ‘qpu.QPU’>): QPU object that represents the virtual QPU to which the job is going to be sent.

circ (json dict, <class ‘qiskit.circuit.quantumcircuit.QuantumCircuit’> or QASM2 str): circuit to be run.

transpile (bool): if True, transpilation will be done with respect to the backend of the given QPU. Default is set to False.

initial_layout (list[int]): initial position of virtual qubits on physical qubits for transpilation, lenght must be equal to the number of qubits in the circuit.

opt_level (int): optimization level for transpilation, default set to 1.

**run_parameters : any other simulation instructions.

Methods

__init__(qpu, circ, transpile[, ...])

Initializes the QJob class.

result()

Synchronous method to obtain the result of the job.

submit()

Asynchronous method to submit a job to the corresponding QClient.

time_taken()

Method to obtain the time that the job took.

upgrade_parameters(parameters)

Asynchronous method to upgrade the parameters in a previously submitted parametric circuit.