Пример #1
0
 def n_operator(self) -> ndarray:
     """
     Returns
     -------
         Returns the :math:`n = - i d/d\\phi` operator in the LC harmonic oscillator basis
     """
     dimension = self.hilbertdim()
     return 1j * (op.creation(dimension) - op.annihilation(dimension)) / (
         self.phi_osc() * math.sqrt(2))
Пример #2
0
 def phi_operator(self) -> ndarray:
     """
     Returns
     -------
         Returns the phi operator in the LC harmonic oscillator basis
     """
     dimension = self.hilbertdim()
     return (op.creation(dimension) +
             op.annihilation(dimension)) * self.phi_osc() / math.sqrt(2)
Пример #3
0
 def phi_operator(self) -> ndarray:
     r"""Returns the phase operator defined as
     :math:`l_\text{osc} (a + a^{\dagger})/\sqrt{2}`, with :math:`a` representing
     an annihilation operator, and :math:`l_\text{osc}` the oscillator length.
     """
     if self.l_osc is None:
         raise ValueError(
             "Variable l_osc has to be set to something other than None\n" +
             "in order to use the phi_operator() method. This can be done by either\n"
             +
             "passing it to the class constructor, or by setting it afterwords."
         )
     a = op.annihilation(self.truncated_dim)
     return self.l_osc / np.sqrt(2) * (a + a.T)
Пример #4
0
 def annihilation_operator(self):
     """Returns the creation operator"""
     return op.annihilation(self.truncated_dim)