After I got the tests to run, I started working my way through the tutorial. Specifically, I am trying part 4. I managed to get to step 18 before I ran into problems. In step 18, we are trying to generate the inital conditions for NewtonX to use. To do this you run a line of code:
To try to figure out what was wrong, I examined the initcond.log file. So far I have gotten two different messages which seem to alternate with no real reason. The first occurs early in the run and says:
Cheking input files
Finished run_g09_initcond.pl with ERROR at Tue Nov 22 08:21:30 PST 2016
This error seems to be referring to the same issue with NewtonX inserting an extra /g09/ which we were seeing earlier. However, when I tried using the same set of variable definitions which worked in the tests, it did not change anything. Also, I poked around in the file and found the same qvector error as earlier but instead of crashing after creating the qvector, it continued successfully. So it seems like that error is one that it can sometimes get past.
The message in there said that memory could not be allocated to gaussian. This sounded suspiciously like something wrong with the %mem= line in the gaussian.com input file the Tutorial has you write. I simply deleted that line from the gaussian.com file in the JOB_AD directory and tried Step 18 again. And it works! However it is a rather lengthy step and we should properly submit this job to the batch queue to run it. This will take some work to get going, though Newton-X says there are some useful templates in the /NX-1.4.0-2/batch directory (files called pini and pini-ew)
This is a short tutorial on how to use the CP2K-NEWTONX interface to a) generate initial conditionsto compute photoabsorption spectra and b) to run non-adiabatic dynamics simulations using orbitalderivative couplings. A more comprehensive tutorial on all NEWTONX features, including adocumentation of the required specifications for the CP2K interface, can be found on the NEWTONXhomepage, -tutorials/.
The interface enables to use electronic-structure data from CP2K and combine it with the surfacehopping module of NEWTONX. Excitation energies \(\Omega^M\) and excited-state eigenvectors\(\mathbfX^M\) to describe the excited state \(M\) are provided by CP2K, relying on the Tamm-Dancoffeigenvalue problem,
By performing a TDDFPT computation, excitation energies \(\Omega^M (\mathbfR(t))\), excited-stateeigenvectors \(\mathbfX^M (\mathbfR(t))\) and corresponding excited-state gradients\(\nabla \Omega^M (\mathbfR(t))\) are provided by CP2K. On the so-defined potential energy surfaces,the nuclei are propagated classically relying on the surface hopping code of NEWTONX,
The input sections for TDDFPT energy and gradient computations are described inTime-Dependent DFT. To furthermore provide the required CP2K output, subsequently readin by NEWTONX, the following print statements have to be added to the CP2K input files:
VIBRATIONAL_ANALYSIS.PRINT.NAMD_PRINT: printsnormal modes to generate initial conditions It should furthermore be noted that cartesiancoordinates have to be provided in terms of the external file coord.cp2k and that the number ofatoms has to be specified in the CP2K input file in the SUBSYSsection.
The following tutorial to obtain photoabsorption spectra is based on section 2 of -content/uploads/2020/02/tutorial-2_2.pdf. For theelectronic-structure calculation with CP2K, a cp2k.inp and cp2k.par file as well as a coordinatefile named coord.cp2k has to be provided in a subdirectory called JOB_AD. Furthermore, avibrational analysis computation has to be performed to provide cartesian normal modes, with theinput file including the corresponding NAMD print section.
After providing the excited-state CP2K computation based on input file h2o_cp2k.inp in thesubdirectory JOB_AD, the normal modes normal_modes_for_h2o-VIBRATIONS-1.eig of the frequencycomputation and the initqp_input file for NEWTONX, the script initcond.pl of NEWTONX can beexecuted to generate initial conditions. The resulting initcond-output file of NEWTONX, it is firststated that the read-in cartesian normal modes are transferred to mass-weighted normal modes.
Based on the initial conditions, the broadened photoabsorption spectrum can be computed with thenxinp script. As outlined in section 2.7 of the cited NEWTONX tutorial, the so-obtained output filecross-section.dat comprises the data points of the computed photoabsorption spectrum as visualizedbelow:
Therefore, wherever in my DG formulation I have the jump of test function u, I replace that with \frac1\kappa_1\nabla u (-). You will also need to edit the coercivity term for the internal discontinuity boundary.
I am pretty new to FEniCS and to FEA, so I skipped fenics and went directly to dolfinx. However, perhaps I can point out a couple of things. Perhaps you can split the variational form from the boundary conditions into separate lines (for readability and ease of debug).
From the tutorial at -tutorial/blob/dokken/dg_tutorial/chapter1/dg.ipynb, I think your variational formulation should be
If you have anaconda, I think you can install dolfinx quite easily in a custom environment according to instructions at GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment. Then you can customize the solution given by smesc at Imposing a discontinuity at interface using DG method - #19 by smesc
Newton-X[1][2] is a general program for molecular dynamics simulations beyond the Born-Oppenheimer approximation. It has been primarily used for simulations of ultrafast processes (femtosecond to picosecond time scale) in photoexcited molecules. It has also been used for simulation of band envelops of absorption and emission spectra.
Newton-X uses the trajectory surface hopping method, a semi-classical approximation in which the nuclei are treated classically by Newtonian dynamics, while the electrons are treated as a quantum subsystem via a local approximation of the Time-dependent Schrdinger Equation. Nonadiabatic effects (the spread of the nuclear wave packet between several states) are recovered by a stochastic algorithm, which allows individual trajectories to change between different potential energy states during the dynamics.
Nonadiabatic couplings, the central quantity in nonadiabatic simulations, can be either provided by a third-party program or computed by Newton-X. When computed by Newton-X, it is done with a numerical approximation based on overlap of electronic wavefunctions obtained in sequential time steps. A local diabatization method is also available to provide couplings in the case of weak nonadiabatic interactions.[3]
Hybrid combination of methods is possible in Newton-X. Forces computed with different methods for different atomic subsets can be linearly combined to generate the final force driving the dynamics. These hybrid forces may, for instance, be combined into the popular electrostatic-embedding quantum-mechanical/molecular-mechanical method (QM/MM). Important options for QM/MM simulations, such as link atoms, boundaries, and thermostats are available as well.
As part of the initial conditions module, Newton-X can simulate absorption, emission, and photoelectron spectra, using the Nuclear Ensemble approach,[4] which provides full spectral widths and absolute intensities.
Newton-X can either compute nonadiabatic couplings during the dynamics or read them from an interfaced third-party program. The computation of the couplings in Newton-X is done by finite differences, following the Hammes-Schiffer-Tully approach.[5] In this approach, the key quantity for computation of the surface hopping probability, the inner product between the nonadiabatic couplings (τLM) and the nuclear velocities (v) at time t, is given by
This method can be generally used for any electronic-structure method, provided that a configuration interaction representation of the electronic wavefunction can be worked out. In Newton-X, it is used with a number of quantum-chemical methods, including MCSCF (Multiconfigurational Self-Consistent Field), MRCI (Multi-Reference Configuration Interaction), CC2 (Coupled Cluster to Approximated Second Order), ADC(2) (Algebraic Diagrammatic Construction to Second Order), TDDFT (Time-Dependent Density Functional Theory), and TDA (Tamm-Dankov Approximation). In the case of MCSCF and MRCI, the configuration interaction coefficients are directly used for computation of couplings. For the other methods, the linear-response amplitudes are used as the coefficients of a configuration interaction wavefunction with single excitations.
Newton-X simulates absorption and emission spectra using the Nuclear Ensemble approach.[4] In this approach, an ensemble of nuclear geometries is built in the initial state and the transition energies and transition moments to the other states are computed for each geometry in the ensemble. A convolution of the results provides spectral widths and absolute intensities.
In the Nuclear Ensemble approach, the photoabsorption cross section for a molecule initially in the ground state and being excited with photoenergy E into Nfs final electronic states is given by
The development of Newton-X started in 2005 at the Institute for the Theoretical Chemistry of the University of Vienna. It was designed by Mario Barbatti in collaboration with Hans Lischka. The original code used and expanded routines written by Giovanni Granucci and Maurizio Persico from the University of Pisa.[2]
A modulus for computation of nonadiabatic couplings based on finite differences of either MCSCF or MRCI wavefunctions was implemented by Jiri Pittner (J. Heyrovsky Institute)[6] and later adapted to work with TDDFT.[7] A modulus for QM/MM dynamics was developed by Matthias Ruckenbauer.[8] Felix Plasser implemented the local diabatization method and dynamics based on CC2 and ADC(2).[3] Rachel Crespo-Otero extended the TDDFT and TDA capabilities.[3] An interface to Gamess was added by Aaron West and Theresa Windus (Iowa State University).[9]
c80f0f1006