Skip to main content

Create input files for QDng calculations

Project description

Python package to generate and modify QDng calculations inputs in xml format

Module:

  • inpxml.py: InpXML Class with methods to write and edit xml structures designed as input files for quantum chemistry calculations on QDng package. Requires lxml.

Example:

In:

Tf = 25 # [fs]
dt = 0.25 # [fs]
steps = Tf*41.34/dt
Nfiles = 5e2
wcycle = int(steps/Nfiles)
mass = 1764.30

propa_params = {'dt': dt, 'steps': int(steps), 'wcycle': wcycle, 
            'dir': 'example_directory/', 'nfile': 'norm'}

T00 = {'head':'T', 'name':'Sum', 'mass':mass, 'key':'T'}
V00 = {'head':'V', 'name':'Sum', 'file':'MgH/pots/pot_Sig_0'}
m00 = {'head':'m0', 'name':'Sum', 'Opes':[T00, V00]} 
T11 = {'head':'T', 'ref':'T'}
V11 = {'head':'V', 'name':'Sum', 'file':'MgH/pots/pot_Sig_1'}
m11 = {'head':'m1', 'name':'Sum', 'Opes':[T11, V11]} 
m22 = {'head':'m2', 'name':'Sum', 'Opes':[T11, V11]} 
m10 = {'head':'m10', 'name':'GridDipole', 'file':'mu', 'laser':'Et', 'Opes':[]} 

H_params = {'type':'Multistate', 'Mels':[m00, m11, m10, m22]} 
Hsum = {'type':'Sum', 'Opes':[T00, V00, T00]} 
wf, ef, vib =   [1, ], ['Sig0',], [1, ] # args['wf'], args['ef'], , args['vib'] #
WF_params = {'type':'Multistate', 'states':'1',
         'file':["MgH/efs_{}/ef_{}".format(ef[i], vib[i]) for i in range(len(ef))], 
         'index':[wf[i] for i in range(len(wf))], 'normalize':True}
filter_opes = [{'expeconly':{'name':'Multistate', 'states':WF_params['states'], 'unity':'False', 'header':"mu{}".format(ind)}, 
               'm{}'.format(ind):{'name':'GridPotential', 'file':'MgH/mu/mu_Sig0Sig1'}}
               for ind in [2.1,] ]
#%%
# Initialize
prop = InpXML()
prop.program('propa', propa_params, WF_params)
prop.propagation('Cheby', H_params)
prop.filter('filterpost', filter_opes)
prop.show

# Editing
prop.hamilt = 'name', 'something'
prop.hamilt = 'm0.0/T', 'name', 'something_new'
prop.show
 
# Writing to file
# prop.writexml(filename='filename', txt=True)

Out:

<qdng>
  <propa dt="1" steps="1000" dir="efs_g" Nef="20" conv="1e-11">
    <propagator name="Cheby">
      <hamiltonian name="Multistate">
        <m0.0 name="Sum">
          <T name="GridNablaSq" mass="2000" key="T"/>
          <V name="GridPotential" file="pot_Vg"/>
        </m0.0>
        <m1.1 name="Sum">
          <T ref="T"/>
          <V name="GridPotential" file="pot_Vg"/>
        </m1.1>
        <m1.0 name="GridDipole" file="mu" laser="Et"/>
        <m2.2 name="Sum">
          <T ref="T"/>
          <V name="GridPotential" file="pot_Vg"/>
        </m2.2>
      </hamiltonian>
    </propagator>
    <wf name="Multistate" states="3" normalize="true">
      <wf1 file="MgH/efs_Sig0/ef_1"/>
    </wf>
    <filterpost>
      <expeconly name="Multistate" states="1" unity="False" header="mu2.1">
        <m2.1 name="GridPotential" file="MgH/mu/mu_Sig0Sig1"/>
      </expeconly>
    </filterpost>
  </propa>
</qdng>

<qdng>
  <propa dt="1" steps="1000" dir="efs_g" Nef="20" conv="1e-11">
    <propagator name="Cheby">
      <hamiltonian name="something">
        <m0.0 name="Sum">
          <T name="something_new" mass="2000" key="T"/>
          .
          .
          .

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

pqinput-0.0.409.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

pqinput-0.0.409-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file pqinput-0.0.409.tar.gz.

File metadata

  • Download URL: pqinput-0.0.409.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pqinput-0.0.409.tar.gz
Algorithm Hash digest
SHA256 158726fc420ee4d97a0b5d537a28a7158ae2e75de74f6ceabb3610d1f79eaebf
MD5 cd2971396e5ccd0cacb8d03266185ebd
BLAKE2b-256 5f822222434745e9c6686b15ce76ac9f0f845dd93d18ec9fc8aa3ed8a187eae1

See more details on using hashes here.

File details

Details for the file pqinput-0.0.409-py3-none-any.whl.

File metadata

  • Download URL: pqinput-0.0.409-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pqinput-0.0.409-py3-none-any.whl
Algorithm Hash digest
SHA256 c9433a7c8c7c134493e1ace8f7b65d2ec7efe0af26da80dc804b19767a9937de
MD5 c50c9c578939ad34b5e7c3eff2dd4874
BLAKE2b-256 9d00329f21c68b427e79949751121b4ec4e33a4cbdede7baa1d3a8f05a8ad0e9

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