qat.qpus.AnalogQPU

class qat.qpus.AnalogQPU(hardware_model=None, sim_method='deterministic', use_GPU=False, n_steps=100, error_control=True, abs_tol=1e-05, rel_tol=1e-05, norm_tol=0.1, n_samples=None, precision=2, **kwargs)

An analog QPU simulator based on the Boost.odeint library with C++/CUDA solvers.

It can evolve time-dependent Hamiltonians specified inside a Schedule with or without Lindblad jump operators - see the ‘Analog’ Noise models section.

The simulator uses Runge-Kutta Dormand-Prince 5 implementation provided in Boost.odeint to solve the underlying ODE. By default, the time step is adaptive (error control mode).

Note

This QPU supports computing several observables in the same job, by providing the parameter observables in the Job, in addition to observable.

Note

If the Job is in Observable mode, the value of the observable at each time step will be returned in the Result in the fields value_data and values_data, respectively for the observable and observables of the job. This feature is however not available when using stochastic mode and error control mode simultaneously.

Warning

If the accuracy is too low, the norm of the final state vector may be invalid (i.e. not within the range specified by norm_tol) in which case a QPUException will be raised. Adjust the number of steps or tolerances, depending on whether error control mode is used or not, to fix this issue.

Parameters:
  • hardware_model (HardwareModel, optional) – a hardware model (containing e.g jump operators). Default is None for noiseless simulations.

  • sim_method (string, optional) – deterministic or stochastic mode, the latter used for noisy simulations and requiring a HardwareModel with jump operators. Default is deterministic.

  • use_GPU (bool, opotional) – off-load the computation on a GPU if one is available. The statevector is then stored on the GPU’s own memory, which is usually smaller than the system memory. Consequently, less qubits can be emulated, but their emulation is typically faster than on CPU. Default is False.

  • n_steps (int, optional) – number of steps for the time-evolution when not in error control mode. Ignored if error_control=True. Default is 100.

  • nsteps (int, optional) – alias for n_steps (legacy)

  • error_control (bool, optional) – whether to use error control mode or not. Defaults to True. In error control mode, the time evolution uses an adaptive time step. Accuracy is controled by the arguments abs_tol and rel_tol.

  • abs_tol (float, optional) – absolute tolerance used by the controlled stepper. Default is 1e-5.

  • rel_tol (float, optional) – relative tolerance used by the controlled stepper. Default is 1e-5.

  • norm_tol (float, optional) – The tolerance (above and below 1) of the norm of the state vector at the end of a simulation. An QPUException is raised if out of this tolerance. Default is 0.1.

  • n_samples (int, optional) – number of trajectories used in stochastic mode. Default is 100.

  • precision (int, optional) – precision of the simulation, choose 1 for floating point precision and 2 for double precision. Default is 2.