IonQ Backends¶
IonQ provider backends.
- class qiskit_ionq.ionq_backend.IonQBackend(*args, **kwargs)[source]¶
IonQ Backend base class.
Initialize a backend class
Deprecated since version 1.2: The class
qiskit.providers.backend.BackendV1
is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. If the backend only encapsulates a hardware description, consider constructing a Target directly. If it is part of a provider that gives access to execution, consider using Primitives instead. Alternatively, consider moving to BackendV2 (see https://qisk.it/backendV1-to-V2).- Parameters:
configuration (BackendConfiguration) – A backend configuration object for the backend object.
provider (qiskit.providers.Provider) – Optionally, the provider object that this Backend comes from.
fields – kwargs for the values to use to override the default options.
- Raises:
AttributeError – if input field not a valid options
- calibration() Calibration | None [source]¶
Fetch the most recent calibration data for this backend.
- Returns:
A calibration data wrapper.
- Return type:
Calibration
- cancel_jobs(job_ids: list[str]) list[dict] [source]¶
cancels a list of jobs from a specific backend, job id
- property client: IonQClient¶
A lazily populated IonQ API Client.
- Returns:
An instance of a REST API client
- Return type:
- configuration()¶
Return the backend configuration.
- Returns:
the configuration for the backend.
- Return type:
BackendConfiguration
- create_client() IonQClient [source]¶
Create an IonQ REST API Client using provider credentials.
- Raises:
IonQCredentialsError – If the provider’s
credentials
does not have a"token"
or"url"
key, or if their values areNone
.- Returns:
An instance of a REST API client.
- Return type:
- abstract gateset() Literal['qis', 'native'] [source]¶
Helper method returning the gateset this backend is targeting.
- has_valid_mapping(circuit: QuantumCircuit) bool [source]¶
checks if the circuit has at least one valid qubit -> bit measurement.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
if the circuit has valid mappings
- Return type:
boolean
- name()¶
Return the backend name.
- Returns:
the name of the backend.
- Return type:
str
- property options¶
Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()
method.
- properties()¶
Return the backend properties.
- Returns:
the configuration for the backend. If the backend does not support properties, it returns
None
.- Return type:
BackendProperties
- provider()¶
Return the backend Provider.
- Returns:
the Provider responsible for the backend.
- Return type:
Provider
- retrieve_jobs(job_ids: list[str]) list[IonQJob] [source]¶
get a list of jobs from a specific backend, job id
- run(circuit: QuantumCircuit, **kwargs) IonQJob [source]¶
Create and run a job on an IonQ Backend.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
A reference to the job that was submitted.
- Return type:
- set_options(**fields)¶
Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Parameters:
fields – The fields to update the options
- Raises:
AttributeError – If the field passed in is not part of the options
- status() BackendStatus [source]¶
Return a backend status object to the caller.
- Returns:
the status of the backend.
- Return type:
BackendStatus
- abstract with_name(name, **kwargs) IonQBackend [source]¶
Helper method that returns this backend with a more specific target system.
- class qiskit_ionq.ionq_backend.IonQQPUBackend(provider: IonQProvider, name: str = 'ionq_qpu', gateset: Literal['qis', 'native'] = 'qis')[source]¶
IonQ Backend for running qpu-based jobs.
Initialize a backend class
Deprecated since version 1.2: The class
qiskit.providers.backend.BackendV1
is deprecated as of qiskit 1.2. It will be removed in the 2.0 release. If the backend only encapsulates a hardware description, consider constructing a Target directly. If it is part of a provider that gives access to execution, consider using Primitives instead. Alternatively, consider moving to BackendV2 (see https://qisk.it/backendV1-to-V2).- Parameters:
configuration (BackendConfiguration) – A backend configuration object for the backend object.
provider (qiskit.providers.Provider) – Optionally, the provider object that this Backend comes from.
fields – kwargs for the values to use to override the default options.
- Raises:
AttributeError – if input field not a valid options
- calibration() Calibration | None ¶
Fetch the most recent calibration data for this backend.
- Returns:
A calibration data wrapper.
- Return type:
Calibration
- cancel_job(job_id: str) dict ¶
cancels a job from a specific backend, by job id.
- cancel_jobs(job_ids: list[str]) list[dict] ¶
cancels a list of jobs from a specific backend, job id
- property client: IonQClient¶
A lazily populated IonQ API Client.
- Returns:
An instance of a REST API client
- Return type:
- configuration()¶
Return the backend configuration.
- Returns:
the configuration for the backend.
- Return type:
BackendConfiguration
- create_client() IonQClient ¶
Create an IonQ REST API Client using provider credentials.
- Raises:
IonQCredentialsError – If the provider’s
credentials
does not have a"token"
or"url"
key, or if their values areNone
.- Returns:
An instance of a REST API client.
- Return type:
- gateset() Literal['qis', 'native'] [source]¶
Helper method returning the gateset this backend is targeting.
- has_valid_mapping(circuit: QuantumCircuit) bool ¶
checks if the circuit has at least one valid qubit -> bit measurement.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
if the circuit has valid mappings
- Return type:
boolean
- name()¶
Return the backend name.
- Returns:
the name of the backend.
- Return type:
str
- property options¶
Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()
method.
- properties()¶
Return the backend properties.
- Returns:
the configuration for the backend. If the backend does not support properties, it returns
None
.- Return type:
BackendProperties
- provider()¶
Return the backend Provider.
- Returns:
the Provider responsible for the backend.
- Return type:
Provider
- retrieve_jobs(job_ids: list[str]) list[IonQJob] ¶
get a list of jobs from a specific backend, job id
- run(circuit: QuantumCircuit, **kwargs) IonQJob ¶
Create and run a job on an IonQ Backend.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
A reference to the job that was submitted.
- Return type:
- set_options(**fields)¶
Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Parameters:
fields – The fields to update the options
- Raises:
AttributeError – If the field passed in is not part of the options
- status() BackendStatus ¶
Return a backend status object to the caller.
- Returns:
the status of the backend.
- Return type:
BackendStatus
- with_name(name: str, **kwargs) IonQQPUBackend [source]¶
Helper method that returns this backend with a more specific target system.
- class qiskit_ionq.ionq_backend.IonQSimulatorBackend(provider, name: str = 'simulator', gateset: Literal['qis', 'native'] = 'qis')[source]¶
IonQ Backend for running simulated jobs.
Attention
When noise_model ideal is specified, the maximum shot-count for a state vector sim is always
1
.Attention
When noise_model ideal is specified, calling
get_counts
on a job processed by this backend will return counts expressed as probabilites, rather than a multiple of shots.Base class for interfacing with an IonQ backend
- calibration() None [source]¶
Simulators have no calibration data.
- Returns:
None
- Return type:
NoneType
- cancel_job(job_id: str) dict ¶
cancels a job from a specific backend, by job id.
- cancel_jobs(job_ids: list[str]) list[dict] ¶
cancels a list of jobs from a specific backend, job id
- property client: IonQClient¶
A lazily populated IonQ API Client.
- Returns:
An instance of a REST API client
- Return type:
- configuration()¶
Return the backend configuration.
- Returns:
the configuration for the backend.
- Return type:
BackendConfiguration
- create_client() IonQClient ¶
Create an IonQ REST API Client using provider credentials.
- Raises:
IonQCredentialsError – If the provider’s
credentials
does not have a"token"
or"url"
key, or if their values areNone
.- Returns:
An instance of a REST API client.
- Return type:
- gateset() Literal['qis', 'native'] [source]¶
Helper method returning the gateset this backend is targeting.
- has_valid_mapping(circuit: QuantumCircuit) bool ¶
checks if the circuit has at least one valid qubit -> bit measurement.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
if the circuit has valid mappings
- Return type:
boolean
- name()¶
Return the backend name.
- Returns:
the name of the backend.
- Return type:
str
- property options¶
Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()
method.
- properties()¶
Return the backend properties.
- Returns:
the configuration for the backend. If the backend does not support properties, it returns
None
.- Return type:
BackendProperties
- provider()¶
Return the backend Provider.
- Returns:
the Provider responsible for the backend.
- Return type:
Provider
- retrieve_jobs(job_ids: list[str]) list[IonQJob] ¶
get a list of jobs from a specific backend, job id
- run(circuit: QuantumCircuit, **kwargs) IonQJob [source]¶
Create and run a job on IonQ’s Simulator Backend.
- Parameters:
circuit (
QuantumCircuit
) – A Qiskit QuantumCircuit object.- Returns:
A reference to the job that was submitted.
- Return type:
- set_options(**fields)¶
Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Parameters:
fields – The fields to update the options
- Raises:
AttributeError – If the field passed in is not part of the options
- status() BackendStatus ¶
Return a backend status object to the caller.
- Returns:
the status of the backend.
- Return type:
BackendStatus
- with_name(name, **kwargs) IonQSimulatorBackend [source]¶
Helper method that returns this backend with a more specific target system.