Devices - Quantum Devices Simulator

class netQuil.devices.Device[source]

Base class for all source and target devices

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

__weakref__

list of weak references to the object (if defined)

apply(program, qubits)[source]

This function should be overwritten by children classes, and should include runtime code defining how child devices impact qubits

Parameters
  • program (Pyquil<Program>) – program to manipulate

  • qubits (List<int>) – list of qubits passing through device

get_results()[source]

Prints device information about trial to console.

reset()[source]

reset is called between trials and resets all properties.

class netQuil.devices.Fiber(length=0.0, attenuation_coefficient=-0.16, apply_error=True)[source]

Bases: netQuil.devices.Device

__init__(length=0.0, attenuation_coefficient=-0.16, apply_error=True)[source]

Simulation of fiber optics with given length and attenuation coefficient.

Parameters
  • length (Float) – length of fiber optical cable in km

  • attenuation_coefficient (Float) – coefficient determining likelihood of photon loss

  • apply_error (Boolean) – True is device should apply error, otherwise, only returns time delay

apply(program, qubits)[source]

Applies device’s error and returns time that photon took to pass through simulated device

Parameters
  • program (Program) – program to be modified

  • qubits (List<int>) – qubits being sent

Returns

time qubits took to travel through fiber

class netQuil.devices.Laser(pulse_length=1e-11, expected_photons=1.0, rotation_prob_variance=1.0, wavelength=1550, apply_error=True)[source]

Bases: netQuil.devices.Device

__init__(pulse_length=1e-11, expected_photons=1.0, rotation_prob_variance=1.0, wavelength=1550, apply_error=True)[source]

Simulation of laser at 1550nm wavelength. Laser produce photons according to poisson distribution, centered around expected_photons.

apply(program, qubits)[source]

Applies laser effect to qubits :param Program program: global program :param List<int> qubits: list of qubits going through laser :return: time it took qubits to pass through device

get_results()[source]

Prints device information about trial to console.

reset()[source]

reset is called between trials and resets all properties.