c12_callisto_clients.qiskit_back package

Submodules

c12_callisto_clients.qiskit_back.c12sim_backend module

class c12_callisto_clients.qiskit_back.c12sim_backend.C12SimBackend(name: str, request: Request, provider: Provider | None = None, properties: dict | None = None, **fields)

Bases: BackendV2

C12 simulator backend wrapper for Qiskit’s BackendV2 class.

acquire_channel(qubit: int)

Return the acquisition channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.

Returns:

AcquireChannel: The Qubit measurement acquisition line.

Raises:
NotImplementedError: if the backend doesn’t support querying the

measurement mapping

control_channel(qubits: Iterable[int])

Return the secondary drive channel for the given qubit

This is typically utilized for controlling multiqubit interactions. This channel is derived from other channels.

This is required to be implemented if the backend supports Pulse scheduling.

Args:
qubits: Tuple or list of qubits of the form

(control_qubit, target_qubit).

Returns:

List[ControlChannel]: The multi qubit control line.

Raises:
NotImplementedError: if the backend doesn’t support querying the

measurement mapping

drive_channel(qubit: int)

Return the drive channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.

Returns:

DriveChannel: The Qubit drive channel

Raises:
NotImplementedError: if the backend doesn’t support querying the

measurement mapping

property dtm: float

Return the system time resolution of output signals

Returns:

dtm: The output signal timestep in seconds.

Raises:
NotImplementedError: if the backend doesn’t support querying the

output signal timestep

get_job(job_uuid: str) C12SimJob | None

Get the job with a given uuid.

Parameters:

job_uuid – uuid of a job

Returns:

None or an instance of C12SimJob class

jobs(limit: int = 50, offset: int = 0) List[C12SimJob]

Returns all the jobs associated to the user for the backend.

Parameters:
  • limit – number of records to be returned

  • offset – offset from start

Returns:

list of C12SimJob

property max_circuits

The maximum number of circuits (or Pulse schedules) that can be run in a single job.

If there is no limit this will return None

property meas_map: List[List[int]]

Return the grouping of measurements which are multiplexed

This is required to be implemented if the backend supports Pulse scheduling.

Returns:

meas_map: The grouping of measurements which are multiplexed

Raises:
NotImplementedError: if the backend doesn’t support querying the

measurement mapping

measure_channel(qubit: int)

Return the measure stimulus channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.

Returns:

MeasureChannel: The Qubit measurement stimulus line

Raises:
NotImplementedError: if the backend doesn’t support querying the

measurement mapping

property request
run(run_input, **options) C12SimJob | List[C12SimJob]

This method returns a Job object that runs circuits.

Parameters:
  • run_input – (QuantumCircuit) or list: object to run on the backend.

  • options – Any kwarg options to pass to the backend for running the config.

Returns:

C12SimJob instance

Raises:
  • C12SimJobError – if there is an error starting a job

  • ValueError – if arguments are not proper type

property target

The Target class is used to represent a backend or hardware target. It provides information about the capabilities and properties of a quantum device or simulator, such as the number of qubits, available gates, and measurement options. This information can be used to configure and validate quantum circuits before they are executed on the target backend.

See: https://qiskit.org/documentation/stubs/qiskit.transpiler.Target.html

Returns:

Target object

c12_callisto_clients.qiskit_back.c12sim_job module

class c12_callisto_clients.qiskit_back.c12sim_job.C12SimJob(backend: BackendV2, job_id: str, **metadata)

Bases: JobV1

Class representing the C12Sim Job

backend()

Return the backend where this job was executed.

cancel()

Attempt to cancel the job.

error_message() str | None

Provide details about the reason of a job failure.

Returns:

An error report if the job failed or None

get_circuit(transpiled: bool = False) QuantumCircuit | None

Method return QuantumCircuit object for a given job.

Returns:

QuantumCircuit or None

get_mid_density_matrix(barrier: int) DensityMatrix | None

Function to get the mid-circuit density matrix (if any).

Parameters:

barrier – ordinal number of barrier

Returns:

DansityMatrix instance

get_mid_statevector(barrier: int) Statevector | None

Function to get the mid-circuit statevector (if any).

Parameters:

barrier – ordinal number of barrier

Returns:

Statevector instance

get_qasm(transpiled: bool = False) str | None

Method returns the qasm string for a given job.

Returns:

qasm str or None

refresh() None

Obtain the latest job information from the server. Function has a side effect of changing private fields.

Returns:

None

result(timeout: float | None = None, wait: float = 5)

Return the results of the job.

shots() int

Return the number of shots.

Returns:

number of shots.

status() JobStatus

Get the latest job status of a current job instance.

Returns:

The status of the job.

submit()

Not implemented methods as to submit a job we are using run() method.

Returns:

Raises:

NotImplementedError

c12_callisto_clients.qiskit_back.c12sim_job.get_qiskit_status(status: str) JobStatus

Function to get Qiskit’s JobStatus status of a job.

Parameters:

status – String with job’s status description.

Returns:

JobStatus

Raises:

C12SimJobError – if unknown status is given

c12_callisto_clients.qiskit_back.c12sim_provider module

class c12_callisto_clients.qiskit_back.c12sim_provider.C12SimProvider(user_config: UserConfigs)

Bases: ProviderV1

Class that represent a Provider class for C12 simulator. It gives (provides) access to C12SIM backend.

backends(name=None, **kwargs) List[str]

Return all available backends for the current user.

Parameters:
  • name – string of backend name

  • kwargs – optional args

Returns:

list of backend objects

Raises:

C12SimApiError – if an error occurred during the API request

get_backend(name=None, **kwargs) C12SimBackend | None

Function to get a backend from a current provider.

Parameters:
  • name – string representing the name of a backend

  • kwargs

Returns:

C12SIMBackend instance

Raises:
  • QiskitBackendNotFoundError – if there is no backend available

  • C12SimApiError – if there is a problem in communication with remote server

property user_configs

c12_callisto_clients.qiskit_back.exceptions module

exception c12_callisto_clients.qiskit_back.exceptions.C12SimApiError

Bases: Exception

Error that happened during the communication with a server

exception c12_callisto_clients.qiskit_back.exceptions.C12SimJobError

Bases: Exception

Errors raised when a job failed.

Module contents