bfqcircuits.core package

Core package of Black Forest Quantum Circuits

Submodules

bfqcircuits.core.fit_fluxonium module

class bfqcircuits.core.fit_fluxonium.FitFluxonium

Bases: Fluxonium

fit()

Run the fit routine. The fit is performed on the fluxonium parameters w, Ej, and flux_zpf. The initial guess with respect to this parameters must be correct within a factor of 10.

Returns:

None

plot_fit(ax, n=0, pext_sweep=None)

Plot of the measured and calculated fluxonium spectrum.

Parameters:
  • ax – matplotlib axes instance

  • n – optional number of lower states that will be plotted, if not given inferred from the measured data

  • pext_sweep – optional 1D-numpy array with the external flux bias in [rad]

Returns:

None

set_initial_value(data, L, C, Ej, N)

Initialization of fit routine.

Parameters:
  • data – numpy array of shape (n, 3) -> [[external flux in (rad), energy in (GHz), state], …]

  • L – initial guess inductance in [H]

  • C – initial guess capacitance in [F]

  • Ej – initial guess Josephson energy in [GHz]

  • N – number of basis states

Returns:

None

bfqcircuits.core.fluxonium module

class bfqcircuits.core.fluxonium.Fluxonium

Bases: object

class Parameters(fluxonium)

Bases: object

add_groundstate_energy()

Adds ground state energy to self.E.

Returns:

None

add_groundstate_energy_sweep()

Subtracts ground state energy from self.E_sweep.

Returns:

None.

calc_capacitive_loss(state_i, state_f, Q_cap, environment='TLSs', T=0.0)

Calculation of the capacitive qubit loss between two states.

Parameters:
  • state_i – initial state.

  • state_f – final state.

  • Q_cap – quality factor of the inductor.

  • environment – either “TLSs” or “Bosonic”.

  • T – Temperature of the environment.

Returns:

1D numpy array with G1 rates in [MHz].

calc_capacitive_loss_sweep(state_i, state_f, Q_cap, environment='TLSs', T=0.0)

Calculation of the capacitive qubit loss between two states as a function of the sweep parameter.

Parameters:
  • state_i – initial state.

  • state_f – final state.

  • Q_cap – quality factor of the capacitor.

  • environment – either “TLSs” or “Bosonic”.

  • T – Temperature of the environment.

Returns:

1D numpy array with G1 rates in [MHz].

calc_dipole_moments(state1, state2)

Calculation of the flux and charge dipole moments between two states.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_dipole_moments_sweep(state1, state2)

Calculation of the flux and charge dipole moments between two states as a function of the sweep parameter.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

None.

calc_hamiltonian_parameters()

Calculation of all relevant fluxonium parameters.

Returns:

None.

calc_inductive_loss(state_i, state_f, Q_ind, environment='TLSs', T=0.0)

Calculation of the inductive qubit loss between two states.

Parameters:
  • state_i – initial state.

  • state_f – final state.

  • Q_ind – quality factor of the inductor.

  • environment – either “TLSs” or “Bosonic”.

  • T – Temperature of the environment.

Returns:

1D numpy array with G1 rates in [MHz].

calc_inductive_loss_sweep(state_i, state_f, Q_ind, environment='TLSs', T=0.0)

Calculation of the inductive qubit loss between two states as a function of the sweep parameter.

Parameters:
  • state_i – initial state.

  • state_f – final state.

  • Q_ind – quality factor of the inductor.

  • environment – either “TLSs” or “Bosonic”.

  • T – Temperature of the environment.

Returns:

1D numpy array with G1 rates in [MHz].

calc_sin_phi_over_two(state1, state2)

Calculation of the sin(phi/2) matrix element between two states.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

sin(phi/2) matrix element.

calc_sin_phi_over_two_sweep(state1, state2)

Calculation of the sin(phi/2) matrix element between two states as a function of the sweep parameter.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

1D numpy array with sin(phi/2) matrix elements.

convergence_sweep(N_max)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

N_max – maximum number of basis states to be used.

Returns:

None.

diagonalize_hamiltonian()

Numerical diagonalization of the fluxonium Hamiltonian.

Returns:

None.

draw_circuit()

Creates a figure with the circuit.

Returns:

matplotlib figure instance

inspect_sweep(step)

Reset fluxonium to a specific sweep index. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None.

plot_convergence_sweep(ax, n)

Plot of energy convergence. This routine assumes that a convergence_test has been performed.

Parameters:
  • ax – matplotlib axes instance.

  • n – number of lower states that will be plotted.

Returns:

None.

plot_dipole_to_various_states_sweep(ax, ref_state, state_list, dipole='flux')

3D plot of dipole moments as a function of the sweep parameter.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • ref_state – state of interest.

  • state_list – list or 1D numpy array of other states.

  • dipole – either “flux” or “charge” for flux and charge dipole moments, respectively.

Returns:

None.

plot_energy_sweep(ax, n)

Plot of the fluxonium energies as a function of the sweep parameter.

Parameters:
  • ax – matplotlib axes instance.

  • n – list/array of states that will be plotted.

Returns:

None.

plot_fluxonium(ax, n, x_range=2.0, unit_mass=False, fill_between=True, scale=None)

Plot of the potential and wave functions.

Parameters:
  • ax – matplotlib axes instance.

  • n – number of lower states that will be plotted.

  • x_range – x-axis range that will be plotted in units depending on unit_mass.

  • unit_mass – if False the flux potential is plotted in units of Phi_0. if True the potential is transformed to correspond to a particle of unit mass and is plotted in units of 1 / sqrt(GHz).

  • fill_between – fill wave functions.

  • scale – scale the amplitude of wave functions.

Returns:

None.

set_flux_squid(p_ext)

Calculation of the effective Josephson energy and effective flux bias.

Parameters:

p_ext – external flux bias in [rad].

Returns:

None.

set_parameters(L=None, C=None, Ej=None, Ejs=None, Ejd=None, ratio=None, p_ext=None, N=None)

Helper routine to set relevant fluxonium parameters.

Parameters:
  • L – inductance in [H].

  • C – capacitance in [F].

  • Ej – Josephson energy in [GHz].

  • Ejs – sum of the Josephson energies of the SQUID [GHz].

  • Ejd – difference of the Josephson energies (outer junction - inner junction) of the SQUID [GHz].

  • ratio – ratio of the loop areas - fluxonium loop area (enclosed by the inner junction) / SQUID loop area.

  • p_ext – external flux bias in [rad].

  • N – number of basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

substract_groundstate_energy()

Subtracts ground state energy from self.E.

Returns:

None

substract_groundstate_energy_sweep()

Subtracts ground state energy from self.E_sweep.

Returns:

None.

sweep_external_flux(pext_sweep)

Sweep of externally applied magentic flux.

Parameters:

pext_sweep – 1D-numpy array with the external flux bias in [rad].

Returns:

None.

sweep_external_flux_squid(pext_sweep)

Sweep of externally applied global magentic flux to a SQUID-junction fluxonium.

The routine assumes that sum of the SQUID-junction Josephson energies self.Ejs and asymmetry self.Ejd as well as the ratio of fluxonium loop area to SQUID-area (self.ratio) have been defined already. For further details see explanation of self.set_flux_squid().

Parameters:

pext_sweep – 1D-numpy array with the external flux bias in [rad].

Returns:

None.

sweep_parameter(par_sweep, par_name=None)

Sweep of a fluxonium parameter specified by par_name.

Parameters:
  • par_sweep – either dict with keys “L”, “C”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext” and corresponding 1D numpy parameter arrays, or 1D numpy array with parameter sweep for the parameter specified by par_name.

  • par_name – “L”, “C”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext”.

Returns:

None.

bfqcircuits.core.fluxonium_LCAO module

class bfqcircuits.core.fluxonium_LCAO.FluxoniumLCAO

Bases: Fluxonium

calc_dipole_moments(state1, state2)

Calculation of the flux and charge dipole moments between two states.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

absolute flux dipole moment, absolute charge dipole moment

calc_hamiltonian_parameters()

Calculation of all relevant fluxonium parameters

Returns:

None

calc_sin_phi_over_two(state1, state2)

Calculation of the sin(phi/2) matrix element between two states.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

sin(phi/2) matrix element

convergence_sweep(N_max)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

N_max – maximum number of basis states to be used.

Returns:

None.

create_states(state_list)

Helper routine to create the local basis states.

Parameters:

state_list – list of tuples e.g. [(-5, 5), (-2, 2), (-1, 1)], which creates local ground states in the wells from -5 to 5, local excited states in the wells from -2 to 2, etc.

Returns:

None

diagonalize_hamiltonian()

Numerical diagonalization of the fluxonium Hamiltonian. For the solver “eigh” the tupel self.subset = (state_min, state_max) can be given to solve only the states within the subset.

Returns:

None

inspect_sweep(step)

Reset fluxonium to a specific sweep index. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None

plot_fluxonium(ax, n, x_range=5.0, unit_mass=False, fill_between=True, scale=None)

Plot of the potential and wave functions.

Parameters:
  • ax – matplotlib axes instance

  • n – number of lower states that will be plotted

  • x_range – x-axis range that will be plotted in units depending on unit_mass.

  • unit_mass – if False the flux potential is plotted in units of Phi_0. if True the potential is transformed to correspond to a particle of unit mass and is plotted in units of 1 / sqrt(GHz).

  • fill_between – fill wave functions

  • scale – scale the wave functions.

Returns:

None

plot_states(ax, unit_mass=False)

Plot of potential and basis states.

Parameters:
  • ax – matplotlib axes instance

  • unit_mass – if False the flux potential is plotted in units of Phi_0. if True the potential is transformed to correspond to a particle of unit mass and is plotted in units of 1 / sqrt(GHz).

Returns:

None

set_states(states)

Set list of local basis states.

Parameters:

states – 2D numpy array - [[well number, excitation], …]

Returns:

None

bfqcircuits.core.resonator_TLS module

class bfqcircuits.core.resonator_TLS.ResonatorTLS

Bases: ResonatorAtom

class Parameters(resonator_TLS)

Bases: object

calc_atom_dipole_moments(state1, state2)

Calculation of the TLS x- and y-dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute x-dipole moment, absolute y-dipole moment.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator position and momentum dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute position dipole moment, absolute momentum dipole moment.

convergence_sweep(Nr)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

Nr – number of resonator basis states.

Returns:

None.

diagonalize_hamiltonian()

Numerical and analytical diagonalization of the system Hamiltonian.

Returns:

None.

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None.

plot_res_dipole_to_various_states_sweep(ax, ref_state, state_list, dipole='x')

3D plot of dipole moments as a function of the sweep parameter.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • ref_state – state of interest.

  • state_list – list of other states.

  • dipole – either “x” or “y” for flux and charge dipole moments, respectively.

Returns:

None.

set_parameters(wr=None, wa_x=None, wa_y=None, wa_z=None, g=None, RWA=None, Nr=None)

Helper routine to set relevant system parameters.

Parameters:
  • wr – resonator frequency in [GHz].

  • wa_x – qubit energy in x-direction in [GHz].

  • wa_y – qubit energy in y-direction in [GHz].

  • wa_z – qubit energy in z-direction in [GHz].

  • g – transverse (sigma_x * x) coupling strength in [GHz].

  • RWA – boolean toggling the rotating wave approximation.

  • Nr – number of resonator basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

sweep_parameter(par_sweep, par_name=None)

Sweep of system parameters.

Parameters:
  • par_sweep – either dict with keys “wr”, “wa_x”, “wa_y”, “wa_z”, “g” and corresponding 1D numpy parameter arrays, or 1D numpy array with parameter sweep for the parameter specified by par_name.

  • par_name – “wr”, “wa_x”, “wa_y”, “wa_z”, “g”.

Returns:

None.

bfqcircuits.core.resonator_fluxonium module

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxonium(coupling='inductive', basis='product')

Bases: object

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumCapacitive

Bases: ResonatorAtom

class Parameters(resonator_fluxonium)

Bases: object

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

cholesky_transformation()

Cholesky decomposition of the Ec matrix. This allows to transform the Hamiltonian to a particle with uniform and unit mass.

Returns:

wr2, wa2, g_lin_sq - the entries of the harmonic potential matrix hbar**2 omega**2 in [GHz].

convergence_sweep(N_sweep)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

N_sweep – 2D numpy array of numbers of basis states of the form [(Na, Nr), …].

Returns:

None.

draw_circuit()

Creates a figure with the circuit.

Returns:

matplotlib figure instance

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None.

plot_potential(ax, xy_range=2.0, unit_mass=True)

3D plot of the resonator fluxonium potential.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • xy_range – scaler or tupel of the x, y range that will be plotted.

  • unit_mass – if False the flux potential is plotted in units of Phi_0. if True the potential is transformed to correspond to a particle of uniform and unit mass and is plotted in units of 1 / sqrt(GHz).

Returns:

None.

set_flux_squid(p_ext)

Calculation the effective Josephson energy and effective flux bias.

Parameters:

p_ext – external flux bias in [rad].

Returns:

None.

set_parameters(Lr=None, La=None, Cs=None, Cr=None, Ca=None, Ej=None, Ejs=None, Ejd=None, ratio=None, p_ext=None, Na=None, Nr=None)

Helper routine to set relevant fluxonium parameters. When updating inductances or capacitances self.calc_hamiltonian_parameters() has to be called.

Parameters:
  • Lr – resonator inductance in [H].

  • La – qubit inductance in [H].

  • Cr – resonator capacitance (including the shared capacitance) in [F].

  • Ca – fluxonium capacitance (including the shared capacitance) in [F].

  • Cs – shared capacitance in [F].

  • Ej – Josephson energy in [GHz].

  • Ejs – sum of the Josephson energies of the SQUID [GHz].

  • Ejd – difference of the Josephson energies (outer junction - inner junction) of the SQUID [GHz].

  • ratio – ratio of the loop areas - fluxonium loop area (enclosed by the inner junction) / SQUID loop area.

  • p_ext – external flux bias in [rad].

  • Nr – number of resonator basis states.

  • Nr – number of qubit basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

sweep_external_flux(pext_sweep)

Sweep of the externally applied magentic flux.

Parameters:

pext_sweep – 1D numpy array with the external flux bias in [rad].

Returns:

None.

sweep_external_flux_squid(pext_sweep)

Sweep of the externally applied global magentic flux to a SQUID-junction fluxonium.

The routine assumes that sum of the SQUID-junction Josephson energies self.Ejs and asymmetry self.Ejd as well as the ratio of fluxonium loop area to SQUID-area (self.ratio) have been defined. For further details see explanation of self.set_flux_squid().

Parameters:

pext_sweep – 1D numpy array with the external flux bias in [rad].

Returns:

None.

sweep_parameter(par_sweep, par_name=None)

Sweep of system parameters.

Parameters:
  • par_sweep – either dict with keys “Lr”, “La”, “Cr”, “Cs”, “Ca”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext” and corresponding 1D numpy parameter arrays, or 1D numpy array with parameter sweep for the parameter specified by par_name.

  • par_name – “Lr”, “La”, “Cr”, “Ca”, “Cs”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext”.

Returns:

None.

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumCapacitiveNormal

Bases: ResonatorFluxoniumCapacitive

calc_atom_dipole_moments(state1, state2)

Calculation of the fluxonium flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

diagonalize_hamiltonian()

Numerical diagonalization of the system Hamiltonian.

Returns:

None.

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumCapacitiveProduct

Bases: ResonatorFluxoniumCapacitive

class Parameters(resonator_fluxonium)

Bases: Parameters

calc_atom_dipole_moments(state1, state2)

Calculation of the fluxonium flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

diagonalize_hamiltonian()

Numerical diagonalization of the system Hamiltonian.

Returns:

None.

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the parameter sweep.

Returns:

None.

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumInductive

Bases: ResonatorAtom

class Parameters(resonator_fluxonium)

Bases: object

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

convergence_sweep(N_sweep)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

N_sweep – 2D numpy array of numbers of basis states of the form [(Na, Nr), …].

Returns:

None.

draw_circuit()

Creates a figure with the circuit.

Returns:

matplotlib figure instance

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None.

plot_potential(ax, xy_range=2.0, unit_mass=True)

3D plot of the resonator fluxonium potential.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • xy_range – scaler or tupel of the x, y range that will be plotted.

  • unit_mass – if False the flux potential is plotted in units of Phi_0. if True the potential is transformed to correspond to a particle of uniform and unit mass and is plotted in units of 1 / sqrt(GHz).

Returns:

None.

set_flux_squid(p_ext)

Calculation of the effective Josephson energy and effective flux bias.

Parameters:

p_ext – external flux bias in [rad].

Returns:

None.

set_parameters(Lr=None, La=None, Ls=None, Cr=None, Ca=None, Ej=None, Ejs=None, Ejd=None, ratio=None, p_ext=None, Na=None, Nr=None)

Helper routine to set relevant fluxonium parameters. When updating inductances or capacitances self.calc_hamiltonian_parameters() has to be called.

Parameters:
  • Lr – resonator inductance (including the shared inductance) in [H].

  • La – fluxonium inductance (including the shared inductance) in [H].

  • Ls – shared inductance in [H].

  • Cr – resonator capacitance in [F].

  • Ca – qubit capacitance in [F].

  • Ej – Josephson energy in [GHz].

  • Ejs – sum of the Josephson energies of the SQUID [GHz].

  • Ejd – difference of the Josephson energies (outer junction - inner junction) of the SQUID [GHz].

  • ratio – ratio of the loop areas - fluxonium loop area (enclosed by the inner junction) / SQUID loop area

  • p_ext – external flux bias in [rad].

  • Nr – number of resonator basis states.

  • Nr – number of qubit basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

sweep_external_flux(pext_sweep)

Sweep of the externally applied magentic flux.

Parameters:

pext_sweep – 1D numpy array with the external flux bias in [rad].

Returns:

None.

sweep_external_flux_squid(pext_sweep)

Sweep of the externally applied global magentic flux to a SQUID-junction fluxonium.

The routine assumes that sum of the SQUID-junction Josephson energies self.Ejs and asymmetry self.Ejd as well as the ratio of fluxonium loop area to SQUID-area (self.ratio) have been defined.

Parameters:

pext_sweep – 1D numpy array with the external flux bias in [rad].

Returns:

None.

sweep_parameter(par_sweep, par_name=None)

Sweep of a resonator fluxonium parameters.

Parameters:
  • par_sweep – either dict with keys “Lr”, “La”, “Ls”, “Cr”, “Ca”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext” and corresponding 1D numpy parameter arrays, or 1D numpy array with parameter sweep for the parameter specified by par_name.

  • par_name – “Lr”, “La”, “Ls”, “Cr”, “Ca”, “Ej”, “Ejs”, “Ejd”, “ratio”, “p_ext”.

Returns:

None.

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumInductiveNormal

Bases: ResonatorFluxoniumInductive

calc_atom_dipole_moments(state1, state2)

Calculation of the fluxonium flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

diagonalize_hamiltonian()

Numerical diagonalization of the system Hamiltonian.

Returns:

None.

class bfqcircuits.core.resonator_fluxonium.ResonatorFluxoniumInductiveProduct

Bases: ResonatorFluxoniumInductive

class Parameters(resonator_fluxonium)

Bases: Parameters

calc_atom_dipole_moments(state1, state2)

Calculation of the fluxonium flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

diagonalize_hamiltonian()

Numerical diagonalization of the system Hamiltonian.

Returns:

None.

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the parameter sweep.

Returns:

None.

bfqcircuits.core.resonator_transmon module

class bfqcircuits.core.resonator_transmon.ResonatorTransmon

Bases: ResonatorAtom

class Parameters(resonator_transmon)

Bases: object

calc_atom_dipole_moments(state1, state2)

Calculation of the transmon flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_hamiltonian_parameters()

Calculation of all relevant Hamiltonian parameters.

Returns:

None.

calc_resonator_dipole_moments(state1, state2)

Calculation of the resonator flux and charge dipole moments between two states. This routine assumes that the Hamiltonian has been diagonalized using self.diagonalize_hamiltonian().

Parameters:
  • state1 – integer or tupel (na, nr), which requires that the states have been sorted.

  • state2 – integer or tupel (na, nr), which requires that the states have been sorted.

Returns:

absolute flux dipole moment, absolute charge dipole moment.

calc_sin_phi_over_two(state1, state2)

Calculation of the sin(phi/2) matrix element between two states.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

sin(phi/2) matrix element.

calc_sin_phi_over_two_sweep(state1, state2)

Calculation of the sin(phi/2) matrix element between two states as a function of the sweep parameter.

Parameters:
  • state1 – first state.

  • state2 – second state.

Returns:

1D numpy array with sin(phi/2) matrix elements.

diagonalize_hamiltonian()

Numerical diagonalization of the system Hamiltonian.

Returns:

None.

draw_circuit()

Creates a figure with the circuit.

Returns:

matplotlib figure instance

inspect_sweep(step)

Reset system to a specific sweep step. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None.

plot_potential(ax, x_range=2.0)

3D plot of the resonator transmon potential.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • x_range – x-axis range of the resonator that will be plotted in units of Phi_0.

Returns:

None.

set_parameters(Lr=None, Cr=None, Ca=None, Cs=None, Ej=None, ng=None, Na=None, Nr=None)

Helper routine to set relevant system parameters.

Parameters:
  • Lr – resonator inductance in [H].

  • Cr – resonator capacitance in [F].

  • Ca – transmon capacitance (including the shared capacitance) in [F].

  • Cs – shared capacitance in [F].

  • Ej – Josephson energy in [GHz].

  • ng – offset charge in [2e].

  • Na – number of transmon basis states.

  • Nr – number of resonator basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

sweep_offset_charge(ng_sweep)

Sweep of offset charge.

Parameters:

ng_sweep – 1D numpy array with the offset charge values in [2e].

Returns:

None.

sweep_parameter(par_sweep, par_name=None)

Sweep of system parameters.

Parameters:
  • par_sweep – either dict with keys “Lr”, “La”, “Cr”, “Ca”, “Cs” “Ej”, “ng” and corresponding 1D numpy parameter arrays, or 1D numpy array with parameter sweep for the parameter specified by par_name.

  • par_name – “Lr”, “La”, “Cr”, “Ca”, “Cs”, “Ej”, “ng”.

Returns:

None.

bfqcircuits.core.transmon module

class bfqcircuits.core.transmon.Transmon

Bases: object

class Parameters(transmon)

Bases: object

add_groundstate_energy()

Adds ground state energy to self.E.

Returns:

None

add_groundstate_energy_sweep()

Subtracts ground state energy from self.E_sweep.

Returns:

None

calc_dipole_moments(state1, state2)

Calculation of the flux and charge dipole moments between two states.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

absolute flux dipole moment, absolute charge dipole moment

calc_dipole_moments_sweep(state1, state2)

Calculation of the flux and charge dipole moments between two states as a function of the sweep parameter.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

1D numpy array with absolute flux dipole moments, 1D numpy array with absolute charge dipole moments

calc_sin_phi_over_two(state1, state2)

Calculation of the sin(phi/2) matrix element between two states.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

sin(phi/2) matrix element

calc_sin_phi_over_two_sweep(state1, state2)

Calculation of the sin(phi/2) matrix element between two states as a function of the sweep parameter.

Parameters:
  • state1 – first state

  • state2 – second state

Returns:

1D numpy array with sin(phi/2) matrix elements

charge_dispersion_approx(Ej_over_Ec, n)

Approximate formula for the energy charge dispersion.

Parameters:
  • Ej_over_Ec – 1D numpy array with Ej / Ec values

  • n – number of lower states.

Returns:

1D array with the energy charge dispersion in [GHz]

convergence_sweep(N_max)

Convergences of the wave functions and corresponding energies with the number of basis states.

Parameters:

N_max – maximum number of basis states to be used.

Returns:

None

diagonalize_hamiltonian()

Numerical diagonalization of the transmon Hamiltonian.

Returns:

None.

draw_circuit()

Creates a figure with the circuit.

Returns:

matplotlib figure instance

energies_first_order_approx()

First order harmonic oscillator approximation of the transmon energies.

Returns:

1D numpy array with state energies in [GHz]

inspect_sweep(step)

Reset transmon to a specific sweep index. The routine assumes that the sweep has already been performed.

Param:

step: step of the sweep.

Returns:

None

plot_convergence_sweep(ax, n)

Plot of energy convergence. This routine assumes that a convergence_test has been performed.

Parameters:
  • ax – matplotlib axes instance.

  • n – number of lower states that will be plotted.

Returns:

None.

plot_dipole_to_various_states_sweep(ax, ref_state, state_list, dipole='flux')

3D plot of dipole moments as a function of the sweep parameter.

Parameters:
  • ax – matplotlib axes instance with projection=”3d”.

  • ref_state – state of interest.

  • state_list – list or 1D numpy array of other states.

  • dipole – either “flux” or “charge” for flux and charge dipole moments, respectively.

Returns:

None.

plot_energy_sweep(ax, n)

Plot of the transmon energies as a function of the sweep parameter.

Parameters:
  • ax – matplotlib axes instance.

  • n – list/array of states that will be plotted.

Returns:

None.

plot_transmon(ax, n, x_range=1.0, remove_ng=False, fill_between=True, scale=None)

Plot of the potential and wave functions.

Parameters:
  • ax – matplotlib axes instance.

  • n – number of lower states that will be plotted.

  • x_range – x-axis range of the resonator that will be plotted in units of Phi_0.

  • remove_ng – if True, complex valued plane wave from the offset charge is removed from the wave function. If False, complex valued wave functions are plotted

  • fill_between – fill wave functions

  • scale – scale the amplitude of the wave functions

Returns:

None

set_parameters(C=None, Ec=None, Ej=None, ng=None, N=None)

Helper routine to set relevant transmon parameters.

Parameters:
  • C – capacitance in [F].

  • Ec – charging energy in [GHz]. Note the definition Ec = 4e^2 / C.

  • Ej – Josephson energy or list/array with higher harmonic Josephson energies in [GHz].

  • ng – offset charge in [2e].

  • N – number of basis states.

Returns:

None.

show_formulas()

Creates a figure showing the most relevant formulas.

Returns:

matplotlib figure instance

substract_groundstate_energy()

Subtracts ground state energy from self.E.

Returns:

None

substract_groundstate_energy_sweep()

Subtracts ground state energy from self.E_sweep.

Returns:

None

sweep_offset_charge(ng_sweep)

Sweep of offset charge.

Parameters:

ng_sweep – 1D-numpy array with the offset charge values in [2e].

Returns:

None.

sweep_parameter(par_sweep)

Sweep of a transmon parameters.

Parameters:

par_sweep – dict with keys “C”, “Ec”, “Ej”, “ng” and corresponding 1D numpy arrays.

Returns:

None.