Exemple #1
0
    def initialize_for_fourier(self, grid):
        # NOTE: This code is only temporary until we get the
        #       more versatile initial value specifications.

        # TODO: Make a specification of the IV setup in configurations
        Psi = []

        for packet_descr in self._parameters["initvals"]:
            packet = BlockFactory().create_wavepacket(packet_descr)

            # Evaluate the
            X = grid.get_nodes(flat=True)
            values = packet.evaluate_at(X, prefactor=True)

            # Reshape values into hypercubic shape
            values = [val.reshape(grid.get_number_nodes()) for val in values]
            Psi.append(values)

        # TODO: Maybe sum up immediately instead of at the end to reduce memory usage
        Psi = reduce(lambda x, y: x + y, Psi)

        # Pack the values in a WaveFunction instance
        WF = WaveFunction(self._parameters)
        WF.set_grid(grid)
        WF.set_values(Psi)

        return WF
 def __init__(self, wf_params):
     self.l, self.N = wf_params[:2]
     self.wf = WaveFunction(wf_params)
     eta = self.wf.eta
     self.eta_add = np.add.outer(eta, eta)
     self.conj_eta_add = np.add.outer(eta.conj(), eta)
     self.eta_mult = np.multiply.outer(eta, eta)
     self.conj_eta_mult = np.multiply.outer(eta.conj(), eta)
     self.N_cos_ij = np.multiply.outer(self.wf.N_cos, self.wf.N_cos)
Exemple #3
0
    def __init__(self, system_params, wf_params, potential_params, r):
        system = NuclearSystem(wf_params, system_params, potential_params)
        system.calculate_energy()
        self.bound_energy = system.energies[0]

        wf = WaveFunction(wf_params)
        radial_wavefunctions = r * np.matmul(system.C.transpose(), wf.phi(r))
        self.bound_wavefunction = np.abs(radial_wavefunctions[0, :])

        k = np.sqrt(-2 * self.bound_energy * system.mass / system.const1)
        eta = system.mass * system.z1 * system.z2 * system.const2 / k / system.const1

        self.whitw_ = np.array(
            [whitw(-eta, wf.l + 0.5, 2 * k * r_i) for r_i in r], dtype=float)