squadds.calcs package#
Submodules#
squadds.calcs.qubit module#
- class squadds.calcs.qubit.QubitHamiltonian(analysis)[source]#
Bases:
ABC
- abstract E01(EJ, EC)[source]#
Calculate the energy difference between the ground state (|0>) and the first excited state (|1>) of a qubit.
- Parameters:
EJ (-) β Josephson energy of the qubit.
EC (-) β Charging energy of the qubit.
- Returns:
Energy difference between the ground state and the first excited state.
- Return type:
float
- abstract E01_and_anharmonicity(EJ, EC)[source]#
Calculate the energy of the first excited state (E01) and the anharmonicity of a qubit.
- Parameters:
EJ (-) β Josephson energy of the qubit.
EC (-) β Charging energy of the qubit.
- Returns:
Energy of the first excited state. - anharmonicity (float): Anharmonicity of the qubit.
- Return type:
E01 (float)
- abstract EC(cross_to_claw, cross_to_ground)[source]#
Performs error correction on the qubit.
- Parameters:
cross_to_claw (float) β The cross-talk probability from the qubit to the claw.
cross_to_ground (float) β The cross-talk probability from the qubit to the ground.
- Returns:
None
- abstract EJ(f_q, alpha)[source]#
Calculate the Josephson energy (EJ) of a qubit.
- Parameters:
f_q (float) β The qubit frequency in Hz.
alpha (float) β The anharmonicity parameter.
- Returns:
The Josephson energy (EJ) in Joules.
- Return type:
float
- abstract EJ_and_LJ(f_q, alpha)[source]#
Calculate the Josephson energy (EJ) and the Josephson inductance (LJ) for a given qubit frequency (f_q) and anharmonicity (alpha).
- Parameters:
f_q (float) β The qubit frequency in Hz.
alpha (float) β The anharmonicity of the qubit in Hz.
- Returns:
A tuple containing the Josephson energy (EJ) and the Josephson inductance (LJ).
- Return type:
tuple
- abstract calculate_target_quantities(f_res, alpha, g, w_q, N, Z_0=50)[source]#
Calculate the target quantities for a qubit.
- Parameters:
f_res (-) β The resonance frequency of the qubit.
alpha (-) β The anharmonicity of the qubit.
g (-) β The coupling strength between the qubit and the resonator.
w_q (-) β The frequency of the qubit.
N (-) β The number of photons in the resonator.
Z_0 (-) β The characteristic impedance of the resonator. Default is 50 Ohms.
- Returns:
None
- abstract g_alpha_freq(C, C_c, EJ, f_r, res_type, Z0=50)[source]#
Calculate the alpha and frequency of a qubit.
- Parameters:
C (-) β Capacitance of the qubit.
C_c (-) β Coupling capacitance.
EJ (-) β Josephson energy.
f_r (-) β Resonator frequency.
res_type (-) β Resonator type.
Z0 (-) β Characteristic impedance. Default is 50.
- Returns:
Qubit anharmonicity. - freq (float): Qubit frequency.
- Return type:
alpha (float)
- abstract g_and_alpha(C, C_c, f_q, EJ, f_r, res_type, Z0=50)[source]#
Calculate the coupling strength (g) and anharmonicity (alpha) of a qubit.
- Parameters:
C (-) β Capacitance of the qubit.
C_c (-) β Coupling capacitance.
f_q (-) β Frequency of the qubit.
EJ (-) β Josephson energy of the qubit.
f_r (-) β Resonator frequency.
res_type (-) β Type of resonator.
Z0 (-) β Characteristic impedance of the transmission line. Default is 50 Ohms.
- Returns:
Coupling strength of the qubit. - alpha (float): Anharmonicity of the qubit.
- Return type:
g (float)
- abstract g_from_cap_matrix(C, C_c, EJ, f_r, res_type, Z0=50)[source]#
Calculate the coupling strength βgβ of a qubit from the capacitance matrix.
- Parameters:
C (-) β The capacitance matrix.
C_c (-) β The coupling capacitance.
EJ (-) β The Josephson energy.
f_r (-) β The resonant frequency.
res_type (-) β The type of resonator.
Z0 (-) β The characteristic impedance. Default is 50 Ohms.
Returns: - g (float): The coupling strength of the qubit.
squadds.calcs.transmon_cross module#
#!TODO: Generalize the half-wave cavity method usage
- squadds.calcs.transmon_cross.Ec_from_Cs(Cs)[source]#
Calculate the charging energy (Ec) in GHz from the capacitance (Cs) in fF.
- class squadds.calcs.transmon_cross.TransmonCrossHamiltonian(analysis)[source]#
Bases:
QubitHamiltonian
Class representing the Hamiltonian for a transmon qubit in a cross-coupled configuration.
Initialize the TransmonCrossHamiltonian object.
- - analysis
The analysis object associated with the Hamiltonian.
- E01(EJ, EC, ng=0, ncut=30)[source]#
Calculate the energy of the first excited state (E01) of a transmon qubit.
- Parameters:
EJ (-) β Josephson energy of the transmon qubit.
EC (-) β Charging energy of the transmon qubit.
ng (-) β Offset charge on the transmon qubit. Default is 0.
ncut (-) β Truncation level for the transmon qubitβs Hilbert space. Default is 30.
- Returns:
Energy of the first excited state (E01) of the transmon qubit.
- Return type:
E01 (float)
- E01_and_anharmonicity(EJ, EC, ng=0, ncut=30)[source]#
Calculate the energy of the first excited state (E01) and the anharmonicity (alpha) of a transmon qubit.
- Parameters:
EJ (-) β Josephson energy of the transmon qubit.
EC (-) β Charging energy of the transmon qubit.
ng (-) β Offset charge on the transmon qubit. Defaults to 0.
ncut (-) β Truncation level for the transmon qubitβs Hilbert space. Defaults to 30.
- Returns:
Energy of the first excited state (E01) in GHz. - alpha (float): Anharmonicity (alpha) in MHz.
- Return type:
E01 (float)
- EC(cross_to_claw, cross_to_ground)[source]#
Calculate the charging energy (EC) of the transmon qubit.
- Parameters:
cross_to_claw (-) β Capacitance between the cross and the claw.
cross_to_ground (-) β Capacitance between the cross and the ground.
- Returns:
The charging energy of the transmon qubit.
- Return type:
EC
- EJ(w_q, alpha)[source]#
Calculate the Josephson energy (EJ) based on the given qubit frequency (w_q) and anharmonicity (alpha).
- Parameters:
w_q (-) β The qubit frequency.
alpha (-) β The anharmonicity of the qubit.
- Returns:
The Josephson energy of the qubit.
- Return type:
EJ
- EJ_and_LJ(w_q, alpha, *args, **kwargs)[source]#
Calculate the Josephson energy (EJ) and Josephson inductance (Lj) based on the given qubit frequency (w_q) and anharmonicity (alpha).
- Parameters:
w_q (-) β The qubit frequency.
alpha (-) β The anharmonicity of the qubit.
- Returns:
The Josephson energy of the qubit. - Lj: The Josephson inductance of the qubit.
- Return type:
EJ
- add_cavity_coupled_H_params(num_chunks='auto', Z_0=50)[source]#
Add cavity-coupled Hamiltonian parameters to the dataframe.
This method calculates the coupling strength βg_MHzβ between the transmon qubit and the cavity, based on the capacitance matrix, transmon parameters, cavity frequency, resonator type, and characteristic impedance.
- Parameters:
num_chunks (-) β The number of chunks to split the DataFrame into for parallel processing. Default is βautoβ which sets the number of chunks to the number of logical CPUs.
Z_0 (-) β The characteristic impedance of the transmission line. Default is 50 ohms.
- Returns:
None
- add_cavity_coupled_H_params_chunk(chunk, Z_0=50)[source]#
Add cavity-coupled Hamiltonian parameters to the DataFrame chunk.
This method calculates the coupling strength βg_MHzβ between the transmon qubit and the cavity,
- Parameters:
chunk (-) β The DataFrame chunk to which the parameters will be added.
Z_0 (-) β The characteristic impedance of the transmission line. Default is 50 ohms.
- Returns:
The DataFrame chunk with the added parameters.
- Return type:
chunk
- add_qubit_H_params()[source]#
Add qubit Hamiltonian parameters to the DataFrame.
This method calculates and adds the qubit Hamiltonian parameters, such as EC, EJ, and EJEC, to the DataFrame.
- Parameters:
None
- Returns:
None
- add_qubit_H_params_chunk(df)[source]#
Add qubit Hamiltonian parameters to the DataFrame chunk.
This method calculates and adds the qubit Hamiltonian parameters, such as EC, EJ, and EJEC,
- Parameters:
df (-) β The DataFrame chunk to which the parameters will be added.
- Returns:
The DataFrame chunk with the added parameters
- Return type:
df
- calculate_target_quantities(f_res, alpha, g, w_q, res_type, Z_0=50)[source]#
Calculate the target quantities (C_q, C_c, EJ, EC, EJ_EC_ratio) based on the given parameters.
- Parameters:
f_res (-) β The resonator frequency.
alpha (-) β The anharmonicity of the qubit.
g (-) β The coupling strength between the qubit and the resonator.
w_q (-) β The qubit frequency.
res_type (-) β The type of resonator.
Z_0 (-) β The characteristic impedance of the resonator.
- Returns:
The total capacitance of the qubit. - C_c: The coupling capacitance between the qubit and the resonator. - EJ: The Josephson energy of the qubit. - EC: The charging energy of the qubit. - EJ_EC_ratio: The ratio of EJ to EC.
- Return type:
C_q
- chi(EJ, EC, g, f_r)[source]#
Calculate the full cavity frequency shift between |0> and |1> states of a qubit using g, f_r, f_q, and alpha. It uses the result derived using 2nd-order perturbation theory (equation 9 in SQuaDDS paper). :param - EJ: Josephson energy of the transmon qubit. :type - EJ: float :param - EC: Charging energy of the transmon qubit. :type - EC: float :param - g: The coupling strength between the qubit and the cavity. :type - g: float :param - f_r: The resonant frequency of the cavity. :type - f_r: float :param - f_q: The frequency spacing between the first two qubit levels. :type - f_q: float
- Returns:
The full dispersive shift of the cavity
- Return type:
chi (float)
- g_alpha_freq(C, C_c, EJ, f_r, res_type, Z0=50)[source]#
Calculate the coupling strength, anharmonicity, and transition frequency of a transmon qubit.
- Parameters:
C (-) β Total capacitance of the transmon qubit.
C_c (-) β Coupling capacitance between the transmon qubit and the resonator.
EJ (-) β Josephson energy of the transmon qubit.
f_r (-) β Resonator frequency.
res_type (-) β Type of resonator. Must be either βhalfβ or βquarterβ.
Z0 (-) β Characteristic impedance of the transmission line. Defaults to 50.
- Returns:
A tuple containing the coupling strength (g), anharmonicity (alpha), and transition frequency (freq).
- Return type:
(g, alpha, freq) (tuple)
- g_and_alpha(C, C_c, f_q, EJ, f_r, res_type, Z0=50)[source]#
Calculate the coupling strength (g) and anharmonicity (alpha) based on the given parameters.
- Parameters:
C (-) β The capacitance between the qubit and the ground.
C_c (-) β The coupling capacitance between the qubit and the resonator.
f_q (-) β The qubit frequency.
EJ (-) β The Josephson energy of the qubit.
f_r (-) β The resonator frequency.
res_type (-) β The type of resonator.
Z0 (-) β The characteristic impedance of the resonator.
- Returns:
The coupling strength between the qubit and the resonator. - alpha: The anharmonicity of the qubit.
- Return type:
g
- g_from_cap_matrix(C, C_c, EJ, f_r, res_type, Z0=50)[source]#
Calculate the coupling strength βgβ between a transmon qubit and a resonator based on the capacitance matrix.
- Parameters:
C (-) β Capacitance between the qubit and the resonator (in femtofarads, fF).
C_c (-) β Coupling capacitance of the resonator (in femtofarads, fF).
EJ (-) β Josephson energy of the qubit (in GHz).
f_r (-) β Resonator frequency (in GHz).
res_type (-) β Type of resonator. Can be βhalfβ or βquarterβ.
Z0 (-) β Characteristic impedance of the transmission line (in ohms). Default is 50 ohms.
- Returns:
Coupling strength βgβ between the qubit and the resonator (in MHz).
- Return type:
g (float)
- get_freq_alpha_fixed_LJ(fig4_df, LJ_target)[source]#
Calculate the frequencies and anharmonicities of transmons with a fixed LJ value.
- Parameters:
fig4_df (-) β DataFrame containing the values of EC for different transmons.
LJ_target (-) β Target value of LJ in nH.
- Returns:
List of frequencies of the transmons. - alpha: List of anharmonicities of the transmons.
- Return type:
freq
- parallel_process_dataframe(df, num_chunks, Z_0=50)[source]#
Process the DataFrame in parallel.
This method splits the DataFrame into chunks and processes each chunk in parallel.
- Parameters:
df (-) β The DataFrame to be processed.
num_chunks (-) β The number of chunks to split the DataFrame into.
Z_0 (-) β The characteristic impedance of the transmission line. Default is 50
- Returns:
The DataFrame with the added parameters.
- Return type:
df