Hcpb¶
- class Hcpb(nlevels: int = 15, Ej: float = None, Ec: float = 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:
- 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, in the charge basis
n = -nlevels ... nlevels. Real, with the sign convention<k|n|k+1> > 0(the ground state has its largest-magnitude component positive).- Return type:
array
- fij(i: int, j: int)[source]¶
Compute the transition energy (or frequency) between states.
|i> and |j>.
- 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.
The eigenvectors are real (the Hamiltonian is real symmetric for every
ng), and their signs follow a fixed convention:n_ij(k, k+1) > 0for everyk(seeevec_k). The other elements carry the sign that follows, son_ij(j, i) == n_ij(i, j)and gauge-invariant products such asn_ij(0, 1) * n_ij(1, 2) * n_ij(2, 0)(negative atng = 0.25) come out right. Up to 0.9.0 this returned|<i|n|j>|, which is gauge-equivalent to the signed matrix only atng = 0orng = 1/2.
- 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:
- Returns:
Returns a Qutip Qobj corresponding to the number operator for defining couplings in the energy eigen-basis. The off-diagonal elements are the signed
n_ij(real symmetric matrix); the diagonal is set to zero.- Return type:
Qobj
- params_from_freq_fixEC(f01: float, Ec: float, **kwargs)[source]¶
Find transmon Ej given a fixed EC and frequency.
Solves
fij(0, 1) == f01for Ej at the given Ec (and the currentng). With Ec fixed the anharmonicity is not a free parameter, so only the frequency enters the fit.- Parameters:
- Keyword Arguments:
scipy.optimize.least_squares. (Passed to)
- Returns:
Ej in same units
- Return type:
- Warns:
UserWarning – if the solver does not reproduce
f01(forinstance, the target is outside the search bounds).
- 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:
- 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:
- Warns:
UserWarning – if the returned (Ej, Ec) do not reproduce
(f01, anharm), for instance when the target is outside the
search bounds.