tequila.simulators.simulator_api.simulate

tequila.simulators.simulator_api.simulate(objective: Union[Objective, QCircuit], variables: Dict[collections.abc.Hashable, numbers.Real] = None, samples: int = None, backend: str = None, noise: tequila.circuit.noise.NoiseModel = None, device: str = None, *args, **kwargs) → Union[numbers.Real, QubitWaveFunction][source]

Simulate a tequila objective or circuit.

Parameters
  • objective (Objective:) – tequila objective or circuit

  • variables (Dict:) – The variables of the objective given as dictionary with keys as tequila Variables/hashable types and values the corresponding real numbers

  • samples (int, optional:) – if None a full wavefunction simulation is performed, otherwise a fixed number of samples is simulated

  • backend (str, optional:) – specify the backend or give None for automatic assignment

  • noise (NoiseModel, optional:) – specify a noise model to apply to simulation/sampling

  • device – a device upon which (or in emulation of which) to sample

  • *args

  • **kwargs – read_out_qubits = list[int] (define the qubits which shall be measured, has only effect on pure QCircuit simulation with samples)

Returns

the result of simulation.

Return type

float or QubitWaveFunction