class pyquil.pyqvm.PyQVM(n_qubits, quantum_simulator_type=None, seed=None, post_gate_noise_probabilities=None)[source]

PyQuil’s built-in Quil virtual machine.

This class implements common control flow and plumbing and dispatches the “actual” work to quantum simulators like ReferenceWavefunctionSimulator, ReferenceDensitySimulator, and NumpyWavefunctionSimulator

  • n_qubits (int) – The number of qubits. Typically this results in the allocation of a large ndarray, so be judicious.

  • quantum_simulator_type (Optional[Type[AbstractQuantumSimulator]]) – A class that can be instantiated to handle the quantum aspects of this QVM. If not specified, the default will be either NumpyWavefunctionSimulator (no noise) or ReferenceDensitySimulator (noise)

  • post_gate_noise_probabilities (Optional[Dict[str, float]]) – A specification of noise model given by probabilities of certain types of noise. The dictionary keys are from “relaxation”, “dephasing”, “depolarizing”, “phase_flip”, “bit_flip”, and “bitphase_flip”. WARNING: experimental. This interface will likely change.

  • seed (Optional[int]) – An optional random seed for performing stochastic aspects of the QVM.