Hcpb#

class Hcpb(nlevels: int = 15, Ej: float | None = None, Ec: float | None = None, ng: float = 0.5)[source]#

Hamiltonian-model Cooper pair box (Hcpb) class.

Used to model analytically the CPB Hamiltonian quickly and efficiently. Solves in charge basis tridiagonal eigenvalue problem for arbitrary Ej, Ec, ng values.

As long as nlevels remains fixed the number of charge states considered does not change and it does not recreate the arrays, just recomputes the properties

Returns all properties of interest for the CPB.

Generate a Cooper-pair box (CPB) model.

Parameters:
  • nlevels (int) – Number of charge states of the CPB [-nlevels, nlevels+1]

  • Ej (float) – Josephson energy of the JJ

  • Ec (float) – Charging energy of the CPB

  • ng (float) – Offset charge of the CPB (ng=0.5 is the sweet spot). ng only needs to run between -0.5 and 0.5. ng is defined in units of cooper pairs (2e)

Example use:

H = Hcpb(nlevels=15, Ej=13971.3, Ec=295.2, ng=0.001)

print(f'''
Transmon frequencies
ω01/2π = {H.fij(0,1): 6.0f} MHz
  α/2π = {H.anharm(): 6.0f} MHz
''')
import matplotlib.pyplot as plt
for k in range (3):
    ψ, θ = H.psi_k(k)
    plt.plot(θ, ψ.real+ψ.imag, label=f"|{k}>") # it's in either quadrature, but not both
plt.xlabel("Junction phase θ (wrapped in the interval [-π, π])")
plt.ylabel("Re(ψ(θ))")
plt.legend(title="Level")

Attributes

Ec#

Return Ec.

Ej#

Returns Ej.

ng#

Return ng.

nlevels#

Return the number of levels.

Methods

anharm()[source]#

Compute the anharmonicity of the CPB.

Returns:

Anharmonicty defined as E12-E01

Return type:

float

evalue_k(k: int)[source]#

Return the eigenvalue of the Hamiltonian for level k.

Parameters:

k (int) – Index of the eigenvalue

Returns:

eigenvalue of the Hamiltonian

Return type:

float

evec_k(k: int)[source]#

Return the eigenvector of the CPB Hamiltonian for level k.

Parameters:

k (int) – Index of eigenvector

Returns:

Eigenvector of the |k> level of the CPB Hamiltonian

Return type:

array

fij(i: int, j: int)[source]#

Compute the transition energy (or frequency) between states.

|i> and |j>.

Parameters:
  • i (int) – Index of state |i>

  • j (int) – Index of state |j>

Returns:

Eij, the transition energy

Return type:

float

h0_to_qutip(n_transmon: int)[source]#

Wrapper around Qutip to output the diagonalized Hamiltonian truncated up to n levels of the transmon for modeling.

Parameters:

n_transmon (int) – Truncate up to n levels of the Transmon Hamiltonian

Returns:

Returns a Qutip Qobj for the diagonalized transmon

Return type:

Qobj

n_ij(i: int, j: int)[source]#

Compute the value of the number operator for coupling elements together in the energy eigen-basis.

Parameters:
  • i (int) – |i> Index of the transmon

  • j (int) – |j> Index of the transmon

Returns:

Matrix element corresponding to the number operator in the transmon basis n_ij = |<i|n|j>|

Return type:

float

n_to_qutip(n_transmon: int, thresh=None)[source]#

Wrapper around Qutip to output the number operator (charge) for the Transmon Hamiltonian in the energy eigen-basis. Used for computing the coupling between other elements in the system.

Parameters:
  • n_transmon (int) – Number of energy levels to consider

  • thresh (float) – Threshold for keeping small values in the number operator i.e n_{i,i+2} terms drop off exponentially. If None retain all terms. Defaults to None

Returns:

Returns a Qutip Qobj corresponding to the number operator for defining couplings in the energy eigen-basis.

Return type:

Qobj

params_from_freq_fixEC(f01: float, Ec: float, **kwargs)[source]#

Find transmon Ej given a fixed EC and frequency.

Parameters:
  • f01 (float) – Desired qubit frequency

  • Ec (float) – Qubit EC (4ECn^2) in same units as f01

Returns:

Ej in same units

Return type:

float

params_from_spectrum(f01: float, anharm: float, **kwargs)[source]#

Method to work backwards from a desired transmon frequency and anharmonicty to extract the target Ej and Ec for design and fabrication. Updates the class to include these Ej and Ec as the new values for extracting properties.

Parameters:
  • f01 (float) – Desired qubit frequency

  • anharm (float) – Desired qubit anharmonicity (should be negative)

Keyword Arguments:

least_squares (Passed to) –

Returns:

Ej and Ec of the transmon Hamiltonian corresponding to the f01 and anharmonicty of the device

Return type:

(float, float)

psi_k(k: int, pts: int = 1001)[source]#

Return the wavevector of the CPB Hamiltonian in the flux basis. Made compact over the interval of [-pi, pi].

Parameters:
  • k (int) – index of wavevector corresponding to the |k> eigenstate

  • pts (int) – Number of points to approximate the wavevector in the interval [-pi, pi]. Defaults to 1001.

Returns:

Wavevector corresponding the |k> eigenstate

Return type:

array