API reference

CircuitQ class

class circuitq.core.CircuitQ(circuit_graph, ground_nodes=None, offset_nodes=None, force_flux_nodes=None, print_feedback=False, natural_units=False)

Bases: object

A class corresponding to a superconducting circuit.

get_T1_dielectric_loss(excited_level=None)

Estimates the T1 contribution due to dielectric loss. See the preprint on arXiv for more details about the formulas that have been used for this method.

Parameters:

excited_level (int (Default: Number of first state above the groundstate)) – Number of state, which is considered to be the excited state.

Returns:

T1_dielectric_loss – T1 contribution due to dielectric loss.

Return type:

float

get_T1_flux(excited_level=None, lower_bound=False)

Estimates the T1 contribution due to flux noise. See the preprint on arXiv for more details about the formulas that have been used for this method.

Parameters:
  • excited_level (int (Default: Number of first state above the groundstate)) – Number of state, which is considered to be the excited state.

  • lower_bound (bool (Default:False)) – If set to True, a lower bound for the T1 contribution will be calculated by summing over all inductive branches (not just closure branches as in default mode)

Returns:

T1_flux – T1 contribution due to flux noise.

Return type:

float

get_T1_quasiparticles(excited_level=None)

Estimates the T1 contribution due to quasiparticles. See the preprint on arXiv for more details about the formulas that have been used for this method.

Parameters:

excited_level (int (Default: Number of first state above the groundstate)) – Number of state, which is considered to be the excited state.

Returns:

T1_quasiparticle – T1 contribution due to quasiparticles.

Return type:

float

get_classical_hamiltonian()

Returns a Hamiltonian as a Sympy-function for the circuit.

Parameters:

parameters. (No external) –

Returns:

  • h (Sympy Add) – Symbolic Hamiltonian of the circuit

  • h_parameters (list) – List of parameters in the Hamiltonian

get_eigensystem(n_eig=30)

Calculates eigenvectors and eigenstates of the numerical Hamiltonian.

Parameters:

n_eig (int) – Number of returned eigenvalues.

Returns:

  • evals (array) – Array of eigenvalues

  • estates (array) – Array of eigenstates

get_numerical_hamiltonian(n_dim, grid_length=None, unit_cell=False, parameter_values=None, default_zero=True)

Creates a numerical representation of the Hamiltonian using the finite difference method.

Parameters:
  • n_dim (int) – Dimension of numerical matrix of each subsystem. If an even number is given, the value is set to the next odd number. This is done to match the dimension of matrices between the charge and flux basis.

  • grid_length (float (Default 4*np.pi*phi_0)) – The coordinate grid is taken from -grid_length to +grid_length in n_dim steps.

  • unit_cell (bool (Default False)) – If set to True, the coordinate grid for the flux variables is taken to capture the unit cell of the potential. If False, grid_length is used to determine the coordinate grid.

  • parameter_values (list) – Numerical values of system parameters (corresponds to self.h_parameters).

  • default_zero (bool (Default True)) – If set to True, the default valeus of the charge and flux offsets will be 0.

Returns:

h_num – Numeric Hamiltonian of the circuit given as a matrix in array form

Return type:

numpy array

get_spectrum_anharmonicity(nbr_check_levels=3)

Calculates the anharmonicity of the eigenspectrum. The method can handle degenerated eigenenergies. It considers the transition that is the closest to the qubit transition (groundstate-first excited states) and subsequently calculates the quotient between these two transitions and returns abs(1-quotient).

Parameters:

nbr_check_levels (int (Default 3)) – Number of levels that should be considered for this analysis. The counting includes groundstate and first excited state.

Returns:

anharmonicity – abs(1-quotient) as described above

Return type:

float

transform_charge_to_flux()

Transforms the eigenvectors into the flux basis. This is necessary to plot the states as a function of flux if the numerical Hamiltonian was (partially) implemented in the charge basis.

Parameters:

parameters (No external) –

Returns:

estates_in_phi_basis – An array that contains the eigenstates in the flux basis.

Return type:

array

circuitq.functions_file module

circuitq.functions_file.visualize_circuit_general(graph, save_as)

Visualises a circuit by creating a figure to an arbitrary path.

Parameters:
  • graph (NetworkX Graph) – Input circuit

  • save_as (String) – Arbitrary figure path