Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
properties_and_expectation_values [2025/07/21 08:24] – add example [Derivatives with respect to fields (dipole, quadrupole, second and third moments)] dollproperties_and_expectation_values [2025/09/10 06:37] (current) – add example for pop , spin doll
Line 1: Line 1:
- 
- 
 ====== Properties and expectation values ====== ====== Properties and expectation values ======
  
Line 271: Line 269:
 ci;dm,9000.2; ci;dm,9000.2;
 pop;density,9000.2 pop;density,9000.2
 +</code>
 +
 +In the following example, the population for charge and spin is computed:
 +
 +<code - examples/li_pop.inp>
 +geometry={li}
 +basis=vdz
 +hf
 +pop;
 +pop;density,type=spin
 </code> </code>
  
Line 412: Line 420:
 Second derivatives include a minus sign, e.g. $$-\frac{\partial^2 E}{\partial d_i \partial d_j}$$ where $d_i$ are the components of the dipole field. Second derivatives include a minus sign, e.g. $$-\frac{\partial^2 E}{\partial d_i \partial d_j}$$ where $d_i$ are the components of the dipole field.
  
-By default a two-point formula is used for first derivatives (keyword ''CENTRAL''). Alternatively, a forward-difference formula ''FORWARD'' (fast, but inaccurate) or a fourpoint formula may be used ''FOURPOINT'' . For second derivatives, two-point and four-point formulas are implemented. If available, analytical first gradients may be used with the keyword ''use_grad'' so that only the second derivative is done numerically. The default step size is 0.001 a.u. and may be changed with the option ''STRENGTH'' 
  
-The quadrupole tensor is traceless which is exploited by default. It may be switched off with ''ZERO_TRACE_UNUSED''+The syntax for the first or second derivative with respect to a dipole field is like this: 
 + 
 +''FGRAD,OPER=DM,PROC=myproc'' 
 +or 
 +''FPOL,OPER=DM,PROC=myproc'' 
 + 
 +where ''myproc'' has to be defined. 
 + 
 +By default a two-point formula is used for first derivatives (keyword ''CENTRAL''). Alternatively, a forward-difference formula ''FORWARD'' (fast, but inaccurate) or a fourpoint formula may be used ''FOURPOINT''
 + 
 +For second derivatives, central (1 central point + 2 more points for the diagonal part, 2*2 points for the off-diagonal part) and four-point formulas (central point + 4 more points for the diagonal part, 4*4 points for the off-diagonal part) are implemented. If available, analytical first gradients may be used with the keyword ''use_grad'' so that only the second derivative is done numerically. This may require the ''expec'' keyword to compute the analytical first derivative. 
 + 
 +The default step size is 0.001 a.u. and may be changed with the option ''STRENGTH''.  
 + 
 +The quadrupole tensor is traceless which is exploited by default in the case of first derivatives. It may be switched off with ''ZERO_TRACE_UNUSED''
  
 The energy calculation has to be done with a ''PROCEDURE'' (alternatively, ''STARTCMD'' may also be used).  The energy calculation has to be done with a ''PROCEDURE'' (alternatively, ''STARTCMD'' may also be used). 
Line 421: Line 442:
 ==== Examples ==== ==== Examples ====
  
-The first examples shows various possibilities to add perturbations to the one-electron hamiltonian.+This example shows how dipole, quadrupole and third moments can be obtained by computing derivatives with respect to the corresponding fields, and the dipole polarizability.
  
 <code - examples/h2o2_fgrad_fpol.inp> <code - examples/h2o2_fgrad_fpol.inp>
 geometry={4 geometry={4
 H2O2 H2O2
-O1      0.0000  0.7375  -0.0528 +O1      0.0000   0.7375  -0.0528 
-O2      0.0000  -0.7375         -0.0528 +O2      0.0000  -0.7375  -0.0528 
-H3      0.8190  0.8170  0.4220 +H3      0.8190   0.8170   0.4220 
-H4      -0.8190         -0.8170         0.4220+H4     -0.8190  -0.8170   0.4220
 } }
  
Line 449: Line 470:
  
 </code> </code>
 +
 +This example shows how ''use_grad'' may be used:
 +
 +
 +<code - examples/h2o_fpol_dm_use_grad_ccsd.inp>
 +geometry={   3
 +H2O
 +O          0.0000000000        0.0000000000       -0.0573384885
 +H          0.7581330543        0.0000000000        0.5338192442
 +H         -0.7581330543        0.0000000000        0.5338192442
 +}
 +
 +basis=def2-svp
 +{hf}
 +
 +!use first analytial derivative
 +fpol,dm,proc=myproc,use_grad
 +
 +proc myproc
 +{hf}
 +{ccsd
 +expec,dm}
 +endproc
 +
 +
 +!compare with twofold numerical derivative
 +fpol,dm,proc=myproc
 +</code>
 +
  
 ===== Relativistic corrections ===== ===== Relativistic corrections =====