Integrators

Part of the noisy quantum gates approach are the Ito integrals, which come up in the calculations many times and dependent on the pulse shape used to implement the gates. The integration is separated into this class to allow for multiple integration methods, unit testing, and caching.

Classes

class quantum_gates.integrators.Integrator(pulse: Pulse)[source]

Bases: object

Calculates the integrals for a specific pulse parametrization.

Parameters:

pulse (Pulse) – Object specifying the pulse waveform and parametrization.

pulse_parametrization[source]

Function F: [0,1] -> [0,1] representing the parametrization of the pulse.

Type:

callable

use_lookup[source]

Tells whether or not the lookup table of the analytical solution should be used.

Type:

bool

integrate(integrand: str, theta: float, a: float) float[source]

Evaluates the integrand provided as string from zero to a based on the implicit pulse shape scaled by theta.

If the pulse (pulse_parametrization) is None, we assume that the pulse height is constant. In this case, we do not perform numerical calculation but just lookup the result.

Parameters:
  • integrand (str) – Name of the integrand.

  • theta (str) – Upper limit of the integration. Total area of the pulse waveform.

  • a (str) – Scaling parameter.

Returns:

Integration result as float.

Return type:

float

_analytical_integration(integrand_str: str, theta: float, a: float) float[source]

Lookups up the result of the integration for the case that the parametrization is None.

Note

This method can/should only be used when the pulse height is constant. Otherwise, the result would be wrong.

Parameters:
  • integrand_str (str) – Name of the integrand.

  • theta (float) – Upper limit of the integration. Total area of the pulse waveform.

  • a (float) – Scaling parameter.

Return type:

float

_numerical_integration(integrand_name: str, theta: float, a: float) float[source]

Looks up the integrand as function and performs numerical integration from 0 to theta.

Uses the the parametrization specified in the class instance.

Parameters:
  • integrand_name (str) – Name of the integrand.

  • theta (float) – Upper limit of the integration. Total area of the pulse waveform.

  • a (float) – Scaling parameter.

Returns:

Result of the integration as float.

Return type:

float