Skip to content

Commit

Permalink
Fix docstrings formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosavola committed Feb 21, 2022
1 parent 3030b31 commit ccbd35e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions pyEPR/calcs/back_box_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def black_box_hamiltonian(fs, ljs, fzpfs, cos_trunc=5, fock_trunc=8, individual=
All in SI units. The ZPF fed in are the generalized, not reduced, flux.
Description:
Takes the linear mode frequencies, $\omega_m$, and the zero-point fluctuations, ZPFs, and
builds the Hamiltonian matrix of $H_full$, assuming cos potential.
Takes the linear mode frequencies, :math:`\omega_m`, and the zero-point fluctuations, ZPFs, and
builds the Hamiltonian matrix of :math:`H_{full}`, assuming cos potential.
"""
n_modes = len(fs)
njuncs = len(ljs)
Expand Down
3 changes: 1 addition & 2 deletions pyEPR/calcs/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class CalcsBasic():
@staticmethod
def epr_to_zpf(Pmj, SJ, Ω, EJ):
r'''
INPUTS:
All as matrices (numpy arrays)
Arguments, All as matrices (numpy arrays):
:Pnj: MxJ energy-participation-ratio matrix, p_mj
:SJ: MxJ sign matrix, s_mj
:Ω: MxM diagonal matrix of frequencies (GHz, not radians, diagonal)
Expand Down
26 changes: 13 additions & 13 deletions pyEPR/calcs/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class Convert():
Static container class for conversions of units and variables.
TEST CONVERSION:
```python
from pyEPR.toolbox.conversions import Convert
Lj_nH, Cs_fF = 11, 60
Convert.transmon_print_all_params(Lj_nH, Cs_fF);
.. code-block:: python
```
from pyEPR.toolbox.conversions import Convert
Lj_nH, Cs_fF = 11, 60
Convert.transmon_print_all_params(Lj_nH, Cs_fF);
'''
# Known SI prefixed
_prefix = {'y': -24, # yocto
Expand Down Expand Up @@ -109,7 +109,7 @@ def Ej_from_Lj(Lj, units_in='nH', units_out='MHz'):
Josephson Junction energy from Josephson inductance.
Returns in MHz
$E_j = \phi_0^2 / L_J$
:math:`E_j = \phi_0^2 / L_J`
'''
return Convert._convert_num(
# Plank to go from Joules to Hz
Expand All @@ -122,7 +122,7 @@ def Lj_from_Ej(Ej, units_in='MHz', units_out='nH'):
Josephson Junction ind from Josephson energy in MHZ.
Returns in units of nano Henries by default
$E_j = \phi_0^2 / L_J$
:math:`E_j = \phi_0^2 / L_J`
'''
return Convert._convert_num(
lambda _x: (ϕ0**2.)/(_x*Planck), # Plank to go from Joules to Hz
Expand All @@ -133,7 +133,7 @@ def Ic_from_Lj(Lj, units_in='nH', units_out='nA'):
r'''
Josephson Junction crit. curr from Josephson inductance.
$E_j = \phi_0^2 / L_J = \phi_0 I_C $
:math:`E_j = \phi_0^2 / L_J = \phi_0 I_C`
'''
return Convert._convert_num(
lambda _x: ϕ0/_x, # Plank to go from Joules to Hz
Expand All @@ -144,7 +144,7 @@ def Lj_from_Ic(Lj, units_in='nA', units_out='nH'):
r'''
Josephson Junction crit. curr from Josephson inductance.
$E_j = \phi_0^2 / L_J = \phi_0 I_C $
:math:`E_j = \phi_0^2 / L_J = \phi_0 I_C`
'''
return Convert._convert_num(
lambda _x: ϕ0/_x, # Plank to go from Joules to Hz
Expand All @@ -153,10 +153,10 @@ def Lj_from_Ic(Lj, units_in='nA', units_out='nH'):
@staticmethod
def Ec_from_Cs(Cs, units_in='fF', units_out='MHz'):
r'''
Charging energy 4Ec n^2, where n=Q/2e
Charging energy :math:`4E_c n^2`, where :math:`n=Q/2e`
Returns in MHz
$E_{C}=\frac{e^{2}}{2C}J$
:math:`E_{C}=\frac{e^{2}}{2C}J`
'''
return Convert._convert_num(
# Plank to go from Joules to Hz
Expand All @@ -166,11 +166,11 @@ def Ec_from_Cs(Cs, units_in='fF', units_out='MHz'):
@staticmethod
def Cs_from_Ec(Ec, units_in='MHz', units_out='fF'):
r'''
Charging energy 4Ec n^2, where n=Q/2e
Charging energy :math:`4E_c n^2`, where :math:`n=Q/2e`
Returns in SI units, in Farads.
$E_{C}=\frac{e^{2}}{2C}J$
:math:`E_{C}=\frac{e^{2}}{2C}J`
'''
return Convert._convert_num(
# Plank to go from Joules to Hz
Expand Down

0 comments on commit ccbd35e

Please sign in to comment.