Exemple #1
0
    def __init__(self, gpw_filename, Vop_filename, **kwargs):
        GPAW.__init__(self, gpw_filename, **kwargs)

        # Read the complex smooth potential
        tdf = open(Vop_filename + '.sG', 'r')
        NG = np.prod(self.hamiltonian.vt_sG.shape)
        self.cvt_sG = np.fromfile(tdf, dtype=np.complex128, count=NG).reshape(
            self.hamiltonian.vt_sG.shape)

        # Read the complex PAW corrections
        tdaf = open(Vop_filename + '.asp', 'r')
        header = tdaf.readline().split()
        assert len(header) == 3
        self.omega = float(header[0])
        self.eta = float(header[1])
        NA = int(header[2])

        print('TDDFPT')
        print('Omega: %.4f eV' % (self.omega * Hartree))
        print('Eta: %.4f eV' % (self.omega * Hartree))

        self.cH_asp = {}
        for a, dH_sp in self.hamiltonian.dH_asp.items():
            data = tdaf.readline().split()
            a = int(data[0])
            self.cH_asp[a] = np.zeros_like(dH_sp, dtype=complex)
            self.cH_asp[a][:] = np.array([float(x) for x in data[1::2]])
            self.cH_asp[a][:] += 1j * np.array([float(x) for x in data[2::2]])
Exemple #2
0
    def __init__(self, niter, **kwargs):
        """
        -- {niter}: How many iterations to run
        """

        GPAW.__init__(self, **kwargs)
        self.observed_energies = []
        self.niter = niter
Exemple #3
0
    def __init__(self, cavity, dielectric, interactions=None, **gpaw_kwargs):
        """Constructor for SolvationGPAW class.

        Additional arguments not present in GPAW class:
        cavity       -- A Cavity instance.
        dielectric   -- A Dielectric instance.
        interactions -- A list of Interaction instances.
        """
        if interactions is None:
            interactions = []

        self.stuff_for_hamiltonian = (cavity, dielectric, interactions)

        GPAW.__init__(self, **gpaw_kwargs)
Exemple #4
0
    def __init__(self, filename=None, propagator='cn', fxc=None, **kwargs):
        self.time = 0.0
        self.niter = 0
        self.kick_strength = np.zeros(3)
        self.tddft_initialized = False
        self.fxc = fxc
        self.propagator = propagator
        if filename is None:
            kwargs['mode'] = kwargs.get('mode', 'lcao')
        GPAW.__init__(self, filename, **kwargs)

        # Restarting from a file
        if filename is not None:
            #self.initialize()
            self.set_positions()
    def __init__(self, filename=None, propagator_debug=False,
                 propagator='cn', fxc=None, **kwargs):
        self.time = 0.0
        self.niter = 0
        self.kick_strength = [0.0, 0.0, 0.0]
        GPAW.__init__(self, filename, **kwargs)
        self.propagator_debug = propagator_debug
        self.tddft_initialized = False
        self.fxc = fxc
        self.propagator = propagator

        # Restarting from a file
        if filename is not None:
            self.initialize()
            self.set_positions()