Element Classes

Capacitor

class SQcircuit.Capacitor(value, unit=None, requires_grad=False, Q='default', error=0, id_str=None)[source]

Bases: Element

Class that contains the capacitor properties.

Parameters:
  • value (float) – The value of the capacitor.

  • unit (Optional[str]) – The unit of input value. If unit is “THz”, “GHz”, and, etc., the value specifies the charging energy of the capacitor. If unit is “fF”, “pF”, and, etc., the value specifies the capacitance in farad. If unit is None, the default unit of capacitor is “GHz”.

  • requires_grad (bool) – A boolean variable that specifies whether autograd should record operations on this element. This feature is specific to the PyTorch engine.

  • Q (Union[Any, Callable[[float], float]]) – Quality factor of the dielectric of the capacitor which is one over tangent loss. It can be either a float number or a Python function of angular frequency.

  • error (float) – The error of fabrication in percentage.

  • id_str (Optional[str]) – ID string for the capacitor.

value_unit = 'F'
property requires_grad: bool
set_value(v, u='F', e=0.0)[source]

Set the value for the capacitor.

Parameters:
  • v (float) – The value of the element.

  • u (str) – The unit of input value.

  • e (float) – The fabrication error in percentage.

Return type:

None

get_value(u='F')[source]

Return the value of the element in specified unit.

Parameters:

u (str) – The unit of input value. The default is “F”.

Return type:

Union[float, Tensor]


Inductor

class SQcircuit.Inductor(value, unit=None, requires_grad=False, cap=None, Q='default', error=0, loops=None, id_str=None)[source]

Bases: Element

Class that contains the inductor properties.

Parameters:
  • value (float) – The value of the inductor.

  • unit (str) – The unit of input value. If unit is “THz”, “GHz”, and ,etc., the value specifies the inductive energy of the inductor. If unit is “fH”, “pH”, and ,etc., the value specifies the inductance in henry. If unit is None, the default unit of inductor is “GHz”.

  • requires_grad (bool) – A boolean variable that specifies whether autograd should record operations on this element. This feature is specific to the PyTorch engine.

  • loops (Optional[List[Loop]]) – List of loops in which the inductor resides.

  • cap (Optional[Capacitor]) – Capacitor associated to the inductor, necessary for correct time-dependent external fluxes scheme.

  • Q (Union[Any, Callable[[float, float], float]]) – Quality factor of the inductor needed for inductive loss calculation. It can be either a float number or a Python function of angular frequency and temperature.

  • error (float) – The error in fabrication as a percentage.

  • id_str (Optional[str]) – ID string for the inductor.

value_unit = 'H'
property requires_grad: bool
set_value(v, u='H', e=0.0)[source]

Set the value for the element.

Parameters:
  • v (float) – The value of the element.

  • u (str) – The unit of input value.

  • e (float) – The fabrication error in percentage.

Return type:

None

get_value(u='H')[source]

Return the value of the element in specified unit.

Parameters:

u (str) – The unit of input value. The default is “H”.

Return type:

Union[float, Tensor]


Junction

class SQcircuit.Junction(value, unit=None, requires_grad=False, cap=None, A=1e-07, x=3e-06, delta=0.00034, Y='default', error=0, loops=None, id_str=None)[source]

Bases: Element

Class that contains the Josephson junction properties.

Parameters:
  • value (float) – The value of the Josephson junction.

  • unit (str) – The unit of input value. The unit can be “THz”, “GHz”, and ,etc., that specifies the junction energy of the inductor. If unit is None, the default unit of junction is “GHz”.

  • requires_grad (bool) – A boolean variable that specifies whether autograd should record operations on this element. This feature is specific to the PyTorch engine.

  • loops (Optional[List[Loop]]) – List of loops in which the Josephson junction reside.

  • cap (Optional[Capacitor]) – Capacitor associated to the josephson junction, necessary for the correct time-dependent external fluxes scheme.

  • A (float) – Normalized noise amplitude related to critical current noise.

  • x (float) – Quasiparticle density

  • delta (float) – Superconducting gap

  • Y (Union[Any, Callable[[float, float], float]]) – Real part of admittance.

  • error (float) – The error in fabrication as a percentage.

  • id_str (Optional[str]) – ID string for the junction.

value_unit = 'Hz'
property requires_grad: bool
set_value(v, u='Hz', e=0.0)[source]

Set the value for the element.

Parameters:
  • v (float) – The value of the element.

  • u (str) – The unit of input value.

  • e (float) – The fabrication error in percentage.

Return type:

None

get_value(u='Hz')[source]

Return the value of the element in specified unit.

Parameters:

u (str) – The unit of input value. The default is “Hz”.

Return type:

Union[float, Tensor]


Loop

class SQcircuit.Loop(value=0, A=1e-06, requires_grad=False, id_str=None)[source]

Bases: object

Class that contains the inductive loop properties, closed path of inductive elements.

Parameters:
  • value (float) – Value of the external flux in the loop.

  • requires_grad (bool) – A boolean variable that specifies whether autograd should record operations on this loop. This feature is specific to the PyTorch engine.

  • A (float) – Normalized noise amplitude related to flux noise.

  • id_str (Optional[str]) – ID string for the loop.

property requires_grad: bool
value(random=False)[source]

Return the value of the external flux. If random is True, it samples from a normal distribution with variance defined by the flux noise amplitude.

Parameters:

random (bool) – A boolean flag which specifies whether the output is deterministic or random.

Return type:

float

set_flux(value)[source]

Set the external flux associated to the loop.

Parameters:

value (float) – The external flux value

Return type:

None