Package: chi1chi2
chi1chi2programThe aim of the program is to calculate linear (refractive indices)
and nonlinear (chi(2)for second harmonic generation)
optical properties of organic crystals.[TOC]InstallationMake sure you have installed:gfortranpython 3.6Installation:pip install chi1chi2for the fortran programs a Makefile is provided with the repository:makecommand builds the programs in the build/ directory#DescriptionThe whole program constitutes a set of scripts that need to be executed in order.There are four main steps:Input preparation (optionally - geometry optimization)Optical properties of molecular sub-units calculationsCalculations of bulk propertiesAnalysis of the resultsThe purpose of this file is to lead the user through all these steps.Step1- Input preparationA) from Cif (easy path)usechi.from_cifto get geometry for further optimization withe.g.crystal09/14/..B) from fractional coordinatesusechi.from_frascript (see: examples/mna_cif.fra, examples/mna_cif2.fra to see the convention)
(remember to adjust the symmetry operations!)C) manuallysee examples for the conventionStep1aafter geometry optimizationD) usechi.from_crystalscript to adjust the coordinates and charges aftercrystalgeometry optimizationE) runchi.input_preparatorscript to get input files for:charge_generatorprogram (example usage:charge_generator < chg1.inp)Lorentz tensor withlorentzprogram (example usage:lorentz < lorentz.inp > L.dat)Step2- property calculationUse sets of charges, geometries and follow your favorite property calculation procedure.
Additional shell scripts could be provided in later releases.Step3- core calculationsUse the scriptchi.mainto get thechi(1)andchi(2)tensor components in the so called a'bc* reference frame.Q-LFT calculations enabled! (since 0.1.1)Step4- result analysisUse the scriptchi.analyzewith output file generated in step 3Refractive indices analysis (since 0.1.3)Magnitude of thechi(2)tensor components in the direction of the optical indicatrix (since 0.1.3)HelpersHelper scripts are available to use around molecular calculations:read_g09.pyfor reading the molecular properties after the QC calculationsscale_props.pyfor scaling the static properties with use of the reference calculationscalc_pol.pyfor calculation of distributed polarizabilities using AIMALL output of finite field calculationsNote: the scripts minimize depencencies on the project library so that they could
be used as standalone scripts on an external machinePreparations for distributed polarizabilities calculationsTwo variants are possible:with only one external field magnitude (0.003 a.u.)The input files for AIMALL have to be preparated in the following convention:1 /no field/; 2 /0.003, 0, 0/; 3 /0, 0.003, 0/; 4 /0, 0, 0.003/;5 /-0.003, 0, 0/; 6 /0, -0.003, 0/; 7 /0, 0, -0.003/with two external field magnitudes (0.003 a.u. and 0.006 a.u.)
(using Romberg numerical differentiation procedure)The input files for AIMALL should follow the convention:1 /no field/; 2 /0.003, 0, 0/; 3 /0, 0.003, 0/; 4 /0, 0, 0.003/;5 /-0.003, 0, 0/; 6 /0, -0.003, 0/; 7 /0, 0, -0.003/8 /0.006, 0, 0/; 9 /0, 0.006, 0/; 10 /0, 0, 0.006/;11 /-0.006, 0, 0/; 12 /0, -0.006, 0/; 13 /0, 0, -0.006/ExamplesSee the examples/examples.pdf to follow the steps used in the integration tests.
The files used for the tests are located in the tests/integration directory:inputas a starting pointexpectedas a referenceExample gaussian09 input file for calculations could be found in examples/mna.comVersion history0.1.0 - first release (31.01.2019)0.1.1 - Q-LFT calculations support added (05.02.2019)0.1.2 - a minor README fix on the PyPI (06.02.2019)0.2.0 - analysis of the core calculations - reporting in tables (09.03.2019)0.2.1 - property scaling helper (27.03.2019)0.3.0 - atomic polarizability scaling approach change (03.03.2020)0.4.0 - distributed polarizability calculation script & format change (10.03.2020)0.4.1 - correction of molecules placement in the unit cell (23.03.2020)0.5.0 - from_crystal old input backing up strategy change (04.04.2020)0.5.1 - HYDROGEN_TOLERANCE environment variable could be used to modify default maximum hydrogen distance (1.15A)0.6.1 - input preparation and main calculations allow for arbitrary redefinition
of molecule-ionic composition of the unit cell (31.08.2020)0.7.0 - fix for calculation of properties in non-orthogonal systems (15.02.2021)0.8.0 - added script for calculation of d_effective for selected solid angles (21.02.2021)0.9.0 - openbabel dependency removed (30.12.2021)0.9.5 - automatic release pipeline (7.01.2022)