def __init__(self, dimension, ncomponents, eps): r"""Initialize a new in homogeneous Hagedorn wavepacket. :param dimension: The space dimension :math:`D` the packet has. :param ncomponents: The number :math:`N` of components the packet has. :param eps: The semi-classical scaling parameter :math:`\varepsilon` of the basis functions. :return: An instance of :py:class:`HagedornWavepacketInhomogeneous`. """ self._dimension = dimension self._number_components = ncomponents self._eps = eps # The parameter sets Pi_i self._Pis = [] # The basis shapes K_i self._basis_shapes = [] # The coefficients c^i self._coefficients = [] for d in range(self._number_components): # Default basis shapes for all components BS = HyperCubicShape(self._dimension * [1]) self._basis_shapes.append(BS) # A Gaussian self._coefficients.append( zeros((BS.get_basis_size(), 1), dtype=complexfloating)) # Default parameters of harmonic oscillator eigenstates q = zeros((self._dimension, 1), dtype=complexfloating) p = zeros((self._dimension, 1), dtype=complexfloating) Q = eye(self._dimension, dtype=complexfloating) P = 1.0j * eye(self._dimension, dtype=complexfloating) S = zeros((1, 1), dtype=complexfloating) self._Pis.append([q, p, Q, P, S]) # Cache basis sizes self._basis_sizes = [bs.get_basis_size() for bs in self._basis_shapes] # No inner product set self._IP = None # Function for taking continuous roots self._sqrt = [ ContinuousSqrt(angle(det(self._Pis[n][2]))) for n in range(self._number_components) ]
def create_basis_shape(self, description): try: bs_type = description["type"] except: # Default setting bs_type = "HyperCubicShape" if bs_type == "HyperCubicShape": from WaveBlocksND.HyperCubicShape import HyperCubicShape limits = description["limits"] BS = HyperCubicShape(limits) elif bs_type == "SimplexShape": from WaveBlocksND.SimplexShape import SimplexShape K = description["K"] D = description["dimension"] BS = SimplexShape(D, K) elif bs_type == "HyperbolicCutShape": from WaveBlocksND.HyperbolicCutShape import HyperbolicCutShape K = description["K"] D = description["dimension"] BS = HyperbolicCutShape(D, K) else: raise ValueError("Unknown basis shape type {}".format(bs_type)) return BS
def __init__(self, dimension, ncomponents, eps): r"""Initialize a new homogeneous Hagedorn wavepacket of the new kind. :param dimension: The space dimension :math:`D` the packet has. :param ncomponents: The number :math:`N` of components the packet has. :param eps: The semi-classical scaling parameter :math:`\varepsilon` of the basis functions. :return: An instance of :py:class:`HagedornWavepacket`. """ self._dimension = dimension self._number_components = ncomponents self._eps = eps # The basis shapes K_i self._basis_shapes = [] # The coefficients c^i self._coefficients = [] for d in range(self._number_components): # Default basis shapes for all components BS = HyperCubicShape(self._dimension * [1]) self._basis_shapes.append(BS) # A Gaussian self._coefficients.append(zeros((BS.get_basis_size(), 1), dtype=complexfloating)) # Cache basis sizes self._basis_sizes = [bs.get_basis_size() for bs in self._basis_shapes] # Default parameters of harmonic oscillator eigenstates q = zeros((self._dimension, 1), dtype=complexfloating) p = zeros((self._dimension, 1), dtype=complexfloating) Q = eye(self._dimension, dtype=complexfloating) P = 1.0j * eye(self._dimension, dtype=complexfloating) S = zeros((1, 1), dtype=complexfloating) # The parameter set Pi self._Pis = [q, p, Q, P, S] # No inner product set self._IP = None # Function for taking continuous roots self._sqrt = ContinuousSqrt(reference=angle(det(Q)))