Skip to main content

set of scripts for calculating linear and nonlinear optical properties of organic crystals

Project description

chi1chi2 program

The aim of the program is to calculate linear (refractive indices) and nonlinear (chi(2) for second harmonic generation) optical properties of organic crystals.

[TOC]


Installation

Make sure you have installed:

  • gfortran
  • python 3.6

Installation:

  • pip install chi1chi2
  • for the fortran programs a Makefile is provided with the repository: make command builds the programs in the build/ directory

#Description

The whole program constitutes a set of scripts that need to be executed in order.

There are four main steps:

  1. Input preparation (optionally - geometry optimization)
  2. Optical properties of molecular sub-units calculations
  3. Calculations of bulk properties
  4. Analysis of the results

The purpose of this file is to lead the user through all these steps.

Step 1 - Input preparation


A) from Cif (easy path)

use chi.from_cif to get geometry for further optimization with e.g. crystal09/14/..

B) from fractional coordinates

use chi.from_fra script (see: examples/mna_cif.fra, examples/mna_cif2.fra to see the convention) (remember to adjust the symmetry operations!)

C) manually

see examples for the convention

Step 1a after geometry optimization


D) use chi.from_crystal script to adjust the coordinates and charges after crystal geometry optimization

E) run chi.input_preparator script to get input files for:

  • charge_generator program (example usage: charge_generator < chg1.inp)
  • Lorentz tensor with lorentz program (example usage: lorentz < lorentz.inp > L.dat)

Step 2 - property calculation


Use sets of charges, geometries and follow your favorite property calculation procedure. Additional shell scripts could be provided in later releases.

Step 3 - core calculations


Use the script chi.main to get the chi(1) and chi(2) tensor components in the so called a'bc* reference frame.

Q-LFT calculations enabled! (since 0.1.1)

Step 4 - result analysis


Use the script chi.analyze with output file generated in step 3

  • Refractive indices analysis (since 0.1.3)
  • Magnitude of the chi(2) tensor components in the direction of the optical indicatrix (since 0.1.3)

Helpers

Helper scripts are available to use around molecular calculations:

  • read_g09.py for reading the molecular properties after the QC calculations
  • scale_props.py for scaling the static properties with use of the reference calculations
  • calc_pol.py for calculation of distributed polarizabilities using AIMALL output of finite field calculations

Note: the scripts minimize depencencies on the project library so that they could be used as standalone scripts on an external machine

Preparations for distributed polarizabilities calculations

Two 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/

Examples

See 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:

  • input as a starting point
  • expected as a reference

Example gaussian09 input file for calculations could be found in examples/mna.com

Version history

  • 0.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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chi1chi2-0.9.0.tar.gz (50.9 kB view details)

Uploaded Source

Built Distribution

chi1chi2-0.9.0-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file chi1chi2-0.9.0.tar.gz.

File metadata

  • Download URL: chi1chi2-0.9.0.tar.gz
  • Upload date:
  • Size: 50.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5

File hashes

Hashes for chi1chi2-0.9.0.tar.gz
Algorithm Hash digest
SHA256 6441c2349864ed58b88ba004a24e966ccbf6a854420c974dad57b7a088456ddf
MD5 ddd27d7439df3f529a7472c4cc7b544c
BLAKE2b-256 1e3de407418baf5d739ade0122f8d7636fe31432fa1feade3bcb0b0d43cd6e89

See more details on using hashes here.

File details

Details for the file chi1chi2-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: chi1chi2-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 72.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.5

File hashes

Hashes for chi1chi2-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5682741005313ae76ca04a6246afc34c08d0fb6156067442db727b66f03b75d3
MD5 cd6328781c576c833d31626157a31de2
BLAKE2b-256 7e7c312f214d58ee93e6c13631eaf4dd5fb87da09f05c6aca311233b793623d1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page