lime/cavity.py
def ham_ho(freq, N, ZPE=False):
    """
    input:
        freq: fundamental frequency in units of Energy
        n : size of matrix
    output:
        h: hamiltonian of the harmonic oscillator
    """

    if ZPE:
        energy = np.arange(N + 0.5) * freq
    else:
        energy = np.arange(N) * freq

    H = lil_matrix((N, N))
    H.setdiag(energy)

    return H.tocsr()

    input:
        freq: fundamental frequency in units of Energy
        n : size of matrix
    output:
        h: hamiltonian of the harmonic oscillator
    
fundamental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscillator
fundamental frequency in units of Energy n : size of matrix output : h : hamiltonian of the harmonic oscillator
def ham_ho(freq, N, ZPE=False):
    if ZPE:
        energy = np.arange(N + 0.5) * freq
    else:
        energy = np.arange(N) * freq
    H = lil_matrix((N, N))
    H.setdiag(energy)
    return H.tocsr()
def ham_ho ( freq , N , ZPE = False ) : if ZPE : energy = np . arange ( N + 0.5 ) * freq else : energy = np . arange ( N ) * freq H = lil_matrix ( ( N , N ) ) H . setdiag ( energy ) return H . tocsr ( )
input:
freq: fundamental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscillator
input : freq : fundamental frequency in units of Energy n : size of matrix output : h : hamiltonian of the harmonic oscillator
"""
    input:
        freq: fundamental frequency in units of Energy
        n : size of matrix
    output:
        h: hamiltonian of the harmonic oscillator
    """
freq
N
ZPE