ibmq_worker¶
Module Contents¶
Functions¶
Retrieves a BackendInfo object for a given device name. |
|
Returns a compilation pass according to the backend info. |
|
Returns the default compilation pass for a given device name. |
|
Returns a predefined compilation pass for IBMQ devices. |
|
Gets a compiled circuit for a given device name. |
|
Applies a predefined optimization pass for IBMQ devices. |
|
Applies a predefined optimization pass for IBMQ devices. |
|
Submits a circuit to an IBMQ backend and returns the result. |
|
Data¶
API¶
- ibmq_worker.worker = 'Worker(...)'¶
- ibmq_worker.get_backend_info(device_name: str) pytket.backends.backendinfo.BackendInfo¶
Retrieves a BackendInfo object for a given device name.
- Parameters:
device_name (str) – The name of the device.
- Raises:
TierkreisError – If the device is not found or not accessible.
- Returns:
The BackendInfo object for the device.
- Return type:
BackendInfo
- ibmq_worker.backend_pass_from_info(backend_info: pytket.backends.backendinfo.BackendInfo, optimisation_level: int = 2) pytket.passes.BasePass¶
Returns a compilation pass according to the backend info.
- Parameters:
backend_info (BackendInfo) – Device information to use for compilation.
optimisation_level (int, optional) – The optimization level for the compilation, defaults to 2
- Returns:
A compilation pass for the backend.
- Return type:
BasePass
- ibmq_worker.backend_default_compilation_pass(device_name: str, optimisation_level: int = 2) pytket.passes.BasePass¶
Returns the default compilation pass for a given device name.
- ibmq_worker.fixed_pass(coupling_map: collections.abc.Sequence[tuple[int, int]], optimisation_level: int = 2) pytket.passes.BasePass¶
Returns a predefined compilation pass for IBMQ devices.
- ibmq_worker.compile(circuit: pytket._tket.circuit.Circuit, device_name: str, optimisation_level: int = 2) pytket._tket.circuit.Circuit¶
Gets a compiled circuit for a given device name.
- ibmq_worker.compile_circuit_ibmq(circuit: pytket._tket.circuit.Circuit, device_name: str, optimisation_level: int = 2) pytket._tket.circuit.Circuit¶
Applies a predefined optimization pass for IBMQ devices.
The optimization pass corresponds to a level=3 optimization.
- Parameters:
circuit (Circuit) – The original circuit.
- Returns:
The optimized circuit.
- Return type:
Circuit
- ibmq_worker.compile_circuits_ibmq(circuits: list[pytket._tket.circuit.Circuit], device_name: str, optimisation_level: int = 2) list[pytket._tket.circuit.Circuit]¶
Applies a predefined optimization pass for IBMQ devices.
- ibmq_worker.run_circuit(circuit: pytket._tket.circuit.Circuit, n_shots: int, device_name: str) pytket.backends.backendresult.BackendResult¶
Submits a circuit to an IBMQ backend and returns the result.
- Parameters:
circuit (Circuit) – The circuit to be run.
n_shots (int) – The number of shots to run.
- Returns:
The backend result.
- Return type:
BackendResult