configuring backends¶
- class qnexus.models.HeliosConfig(
- *,
- type: Literal['HeliosConfig'] = 'HeliosConfig',
- system_name: str = 'Helios-1',
- emulator_config: HeliosEmulatorConfig | None = None,
- max_cost: float | None = None,
- attempt_batching: bool = False,
- max_batch_cost: float = 2000.0,
- options: QuantinuumOptions | None = None,
Configuration for Helios generation QPUs, emulators and checkers.
- class qnexus.models.HeliosEmulatorConfig(
- *,
- n_qubits: int | None = None,
- simulator: ~quantinuum_schemas.models.emulator_config.StatevectorSimulator | ~quantinuum_schemas.models.emulator_config.StabilizerSimulator | ~quantinuum_schemas.models.emulator_config.MatrixProductStateSimulator | ~quantinuum_schemas.models.emulator_config.CoinflipSimulator | ~quantinuum_schemas.models.emulator_config.ClassicalReplaySimulator = <factory>,
- error_model: ~quantinuum_schemas.models.emulator_config.NoErrorModel | ~quantinuum_schemas.models.emulator_config.DepolarizingErrorModel | ~quantinuum_schemas.models.emulator_config.QSystemErrorModel | ~quantinuum_schemas.models.emulator_config.HeliosCustomErrorModel = <factory>,
- runtime: ~quantinuum_schemas.models.emulator_config.HeliosRuntime = <factory>,
Configuration for Helios emulator systems.
- class qnexus.models.SimpleRuntime( )[source]¶
A ‘simple’ runtime for the Selene emulator.
Does not emulate the runtime (e.g. ion transport) of any specific Quantinuum System.
- Parameters:
seed – Random seed for the runtime.
- class qnexus.models.HeliosRuntime( )[source]¶
A Selene runtime that emulates the Helios system, including ion transport.
- Parameters:
seed – Random seed for the runtime.
- class qnexus.models.NoErrorModel( )[source]¶
Model for simulating ideal quantum systems via Selene.
All operations provided by the runtime will be executed as-is, without any errors.
- Parameters:
seed – Random seed for the error model.
- class qnexus.models.DepolarizingErrorModel(
- *,
- type: Literal['DepolarizingErrorModel'] = 'DepolarizingErrorModel',
- seed: int | None = None,
- p_1q: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.0,
- p_2q: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.0,
- p_meas: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.0,
- p_init: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.0,
Model for simulating depolarizing error in quantum systems via Selene.
- Parameters:
seed – Random seed for the error model.
p_1q – The error probability for single-qubit gates.
p_2q – The error probability for two-qubit gates.
p_meas – The error probability for measurement operations.
p_init – The error probability for initialization operations.
- class qnexus.models.QSystemErrorModel(
- *,
- type: Literal['QSystemErrorModel'] = 'QSystemErrorModel',
- seed: int | None = None,
- name: str = 'alpha',
Preconfigured Error Model for simulating error for a specific QSystem via Selene. Will use a preconfiguration of the error model as specified by the name parameter.
- Parameters:
seed – Random seed for the error model.
name – Name of the QSystem error model.
- class qnexus.models.HeliosCustomErrorModel(
- *,
- type: ~typing.Literal['HeliosCustomErrorModel'] = 'HeliosCustomErrorModel',
- seed: int | None = None,
- error_params: ~quantinuum_schemas.models.quantinuum_systems_noise.HeliosErrorParams = <factory>,
Configurable Error Model for simulating error for the Helios system via Selene.
- Parameters:
seed – Random seed for the error model.
error_params – Parameters for the Helios error model.
- class qnexus.models.StatevectorSimulator( )[source]¶
Statevector simulator built on a QuEST backend.
- Parameters:
seed – Random seed for the simulation engine.
- class qnexus.models.StabilizerSimulator(
- *,
- type: Literal['StabilizerSimulator'] = 'StabilizerSimulator',
- seed: int | None = None,
- angle_threshold: Annotated[float, Gt(gt=0)] = 1e-08,
Stabilizer simulator built on a Stim backend. As Stim is a stabilizer simulator, it can only simulate Clifford operations. We provide an angle threshold parameter for users to decide how far angles can be away from pi/2 rotations on the bloch sphere before they are considered invalid. This is to avoid numerical instability, or to inject approximations.
- Parameters:
seed – Random seed for the simulation engine.
angle_threshold – How far angles can be away from pi/2 rotations on the bloch sphere before they are considered invalid.
- class qnexus.models.MatrixProductStateSimulator(
- *,
- type: Literal['MatrixProductStateSimulator'] = 'MatrixProductStateSimulator',
- seed: int | None = None,
- backend: Literal['auto', 'cpu', 'cuda'] = 'auto',
- precision: Literal[32, 64] = 32,
- chi: Annotated[int | None, Gt(gt=0)] = None,
- truncation_fidelity: Annotated[float | None, Gt(gt=0), Le(le=1)] = None,
- zero_threshold: Annotated[float | None, Gt(gt=0), Le(le=1)] = None,
Matrix Product State simulator, built on Quantinuum’s Lean (low-entanglement approximation engine) backend.
- Parameters:
seed – Random seed for the simulation engine.
backend – The classical compute backend to use.
precision – The floating point precision used in tensor calculations.
chi – The maximum value allowed for the dimension of the virtual bonds. Higher implies better approximation but more computational resources. If not provided, chi will be unbounded.
truncation_fidelity – Every time a two-qubit gate is applied, the virtual bond will be truncated to the minimum dimension that satisfies |<psi|phi>|^2 >= trucantion_fidelity, where |psi> and |phi> are the states before and after truncation (both normalised). If not provided, it will default to its maximum value 1.
zero_threshold – Any number below this value will be considered equal to zero. Even when no chi or truncation_fidelity is provided, singular values below this number will be truncated.
- class qnexus.models.CoinflipSimulator(
- *,
- type: Literal['CoinflipSimulator'] = 'CoinflipSimulator',
- seed: int | None = None,
- bias: Annotated[float, Ge(ge=0.0), Le(le=1.0)] = 0.5,
‘Coinflip’ simulator.
Doesn’t maintain any quantum state and picks a random boolean value for each measurement.
- Parameters:
seed – Random seed for the simulation engine.
bias – The bias of the coin flip. This value is the probability that any given measurement will return True.
- class qnexus.models.ClassicalReplaySimulator(
- *,
- type: ~typing.Literal['ClassicalReplaySimulator'] = 'ClassicalReplaySimulator',
- seed: int | None = None,
- measurements: list[list[bool]] = <factory>,
‘Classical Replay’ simulator.
This simulator allows a user to predefine the results of measurements for each shot. No quantum operations are performed.
- Parameters:
seed – Random seed for the simulation engine.
measurements – A list of lists of booleans, where each inner list represents the boolean measurement results for a single shot.
- class qnexus.models.SeleneConfig(
- *,
- n_qubits: int | None = None,
- type: ~typing.Literal['SeleneConfig'] = 'SeleneConfig',
- simulator: ~quantinuum_schemas.models.emulator_config.StatevectorSimulator | ~quantinuum_schemas.models.emulator_config.StabilizerSimulator | ~quantinuum_schemas.models.emulator_config.CoinflipSimulator | ~quantinuum_schemas.models.emulator_config.ClassicalReplaySimulator = <factory>,
- runtime: ~quantinuum_schemas.models.emulator_config.SimpleRuntime = <factory>,
- error_model: ~quantinuum_schemas.models.emulator_config.NoErrorModel | ~quantinuum_schemas.models.emulator_config.DepolarizingErrorModel = <factory>,
Configuration for Quantinuum’s Selene.
- Parameters:
simulator – The simulator backend to use.
runtime – The runtime for the Selene emulator. Runtimes for specific systems will model system aspects such as ion transport.
error_model – The error model for the Selene emulator.
n_qubits – The maximum number of qubits to simulate.
- class qnexus.models.SelenePlusConfig(
- *,
- n_qubits: int | None = None,
- type: ~typing.Literal['SelenePlusConfig'] = 'SelenePlusConfig',
- simulator: ~quantinuum_schemas.models.emulator_config.StatevectorSimulator | ~quantinuum_schemas.models.emulator_config.StabilizerSimulator | ~quantinuum_schemas.models.emulator_config.MatrixProductStateSimulator | ~quantinuum_schemas.models.emulator_config.CoinflipSimulator | ~quantinuum_schemas.models.emulator_config.ClassicalReplaySimulator = <factory>,
- runtime: ~quantinuum_schemas.models.emulator_config.SimpleRuntime | ~quantinuum_schemas.models.emulator_config.HeliosRuntime = <factory>,
- error_model: ~quantinuum_schemas.models.emulator_config.NoErrorModel | ~quantinuum_schemas.models.emulator_config.DepolarizingErrorModel | ~quantinuum_schemas.models.emulator_config.QSystemErrorModel | ~quantinuum_schemas.models.emulator_config.HeliosCustomErrorModel = <factory>,
Configuration for Quantinuum’s Selene Plus, including advanced runtimes and simulators.
- Parameters:
simulator – The simulator backend to use.
runtime – The runtime for the Selene emulator. Runtimes for specific systems (e.g. Helios) will model system aspects such as ion transport.
error_model – The error model for the Selene emulator.
n_qubits – The maximum number of qubits to simulate.
- class qnexus.models.QuantinuumConfig(
- *,
- type: Literal['QuantinuumConfig'] = 'QuantinuumConfig',
- device_name: str,
- simulator: str = 'state-vector',
- machine_debug: bool = False,
- attempt_batching: bool = False,
- allow_implicit_swaps: bool = True,
- postprocess: bool = False,
- noisy_simulation: bool = True,
- target_2qb_gate: str | None = None,
- user_group: str | None = None,
- max_batch_cost: int = 2000,
- compiler_options: QuantinuumCompilerOptions | None = None,
- no_opt: bool = True,
- allow_2q_gate_rebase: bool = False,
- leakage_detection: bool = False,
- simplify_initial: bool = False,
- max_cost: int | None = None,
- error_params: UserErrorParams | None = None,
Runs circuits on Quantinuum’s quantum devices and simulators.
- Parameters:
device_name – The quantum computer or emulator to target.
simulator – If device_name is a simulator, the type of simulator to use.
machine_debug – Whether to run in machine debug mode.
attempt_batching – Whether to attempt batching of circuits.
allow_implicit_swaps – Whether to allow implicit swaps in the compilation process.
postprocess – Apply end-of-circuit simplifications and classical postprocessing to improve fidelity of results
noisy_simulation – Whether to use a noisy simulation with an error model.
target_2qb_gate – The target 2-qubit gate for the compilation process.
compiler_options – Additional options for the Quantinuum Systems compiler.
no_opt – Whether to disable optimization in the compilation process.
allow_2q_gate_rebase – Whether to allow 2-qubit gate rebase in the compilation process.
leakage_detection – If true, adds additional Qubit and Bit to Circuit to detect leakage errors. Run prune_shots_detected_as_leaky on returned BackendResult to get counts with leakage errors removed.
simplify_initial – Apply the pytket SimplifyInitial pass to improve fidelity of results assuming all qubits initialized to zero.
error_params – Additional error parameters for execution on an emulator.
user_group – The user group for the compilation jobs.
max_batch_cost – The maximum HQC cost for a batch of programs (total).
max_cost – The maximum HQC cost for a single programs.
- class qnexus.models.AerConfig(
- *,
- type: Literal['AerConfig'] = 'AerConfig',
- noise_model: AerNoiseModel | None = None,
- simulation_method: str = 'automatic',
- crosstalk_params: CrosstalkParams | None = None,
- n_qubits: Annotated[int, Gt(gt=0)] = 40,
- seed: int | None = None,
Qiskit Aer QASM simulator.
- class qnexus.models.BraketConfig(
- *,
- type: Literal['BraketConfig'] = 'BraketConfig',
- local: bool,
- local_device: str = 'default',
- device_type: str | None = None,
- provider: str | None = None,
- device: str | None = None,
- s3_bucket: str | None = None,
- s3_folder: str | None = None,
- simplify_initial: bool = False,
Runs circuits on quantum devices and simulators using Amazon’s Braket service.
- class qnexus.models.IBMQConfig(
- *,
- type: Literal['IBMQConfig'] = 'IBMQConfig',
- backend_name: str,
- instance: str,
- region: str | None = None,
- monitor: bool = False,
- postprocess: bool = False,
- simplify_initial: bool = False,
Runs circuits on IBM’s quantum devices.
- class qnexus.models.IBMQEmulatorConfig(
- *,
- type: Literal['IBMQEmulatorConfig'] = 'IBMQEmulatorConfig',
- backend_name: str,
- instance: str,
- region: str | None = None,
- seed: int | None = None,
- postprocess: bool = False,
Runs circuits on a Nexus-hosted simulator which uses the noise model of a specific IBM quantum device.