scqubits.Cos2PhiQubit.n_phi_operator#

Cos2PhiQubit.n_phi_operator(energy_esys=False)[source]#

Returns the \(n_\phi\) operator in the harmonic oscillator or eigenenergy basis.

Parameters:

energy_esys (Union[bool, Tuple[ndarray, ndarray]]) – If False (default), returns \(n_\phi\) operator in the native basis. If True, the energy eigenspectrum is computed, returns \(n_\phi\) operator in the energy eigenbasis. If energy_esys = esys, where esys is a tuple containing two ndarrays (eigenvalues and energy eigenvectors), returns \(n_\phi\) operator in the energy eigenbasis, and does not have to recalculate eigenspectrum.

Return type:

Union[ndarray, coo_matrix]

Returns:

\(n_\phi\) operator in chosen basis. If native basis chosen, operator returned as a csc_matrix. If the eigenenergy basis is chosen, unless energy_esys is specified, \(n_\phi\) operator has dimensions of truncated_dim x truncated_dim, and is returned as an ndarray. Otherwise, if eigenenergy basis is chosen, \(n_\phi\) operator has dimensions of m x m, for m given eigenvectors, and is returned as an ndarray \(\zeta\).