# 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:
```xml
<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"/>
.
.
.
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.fysik.su.se/lucas.borges/inputxml",
"name": "pqinput",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "qdng",
"author": "Lucas Borges",
"author_email": "Lucas Borges <lucas.borges@fysik.su.se>",
"download_url": "https://files.pythonhosted.org/packages/1b/48/277ad54979cd704b57a33a88699a55fd52ff1df58b241277fde41ed06ebb/pqinput-0.0.415.tar.gz",
"platform": null,
"description": "# Python package to generate and modify QDng calculations inputs in xml format\n\n### Module:\n- `inpxml.py`: **InpXML** \nClass with methods to write and edit *xml* structures designed as input files for quantum chemistry calculations on QDng package. \nRequires *lxml*.\n\n\n### Example: \n\nIn:\n\n Tf = 25 # [fs]\n dt = 0.25 # [fs]\n steps = Tf*41.34/dt\n Nfiles = 5e2\n wcycle = int(steps/Nfiles)\n mass = 1764.30\n\n propa_params = {'dt': dt, 'steps': int(steps), 'wcycle': wcycle, \n 'dir': 'example_directory/', 'nfile': 'norm'}\n\n T00 = {'head':'T', 'name':'Sum', 'mass':mass, 'key':'T'}\n V00 = {'head':'V', 'name':'Sum', 'file':'MgH/pots/pot_Sig_0'}\n m00 = {'head':'m0', 'name':'Sum', 'Opes':[T00, V00]} \n T11 = {'head':'T', 'ref':'T'}\n V11 = {'head':'V', 'name':'Sum', 'file':'MgH/pots/pot_Sig_1'}\n m11 = {'head':'m1', 'name':'Sum', 'Opes':[T11, V11]} \n m22 = {'head':'m2', 'name':'Sum', 'Opes':[T11, V11]} \n m10 = {'head':'m10', 'name':'GridDipole', 'file':'mu', 'laser':'Et', 'Opes':[]} \n\n H_params = {'type':'Multistate', 'Mels':[m00, m11, m10, m22]} \n Hsum = {'type':'Sum', 'Opes':[T00, V00, T00]} \n wf, ef, vib = [1, ], ['Sig0',], [1, ] # args['wf'], args['ef'], , args['vib'] #\n WF_params = {'type':'Multistate', 'states':'1',\n 'file':[\"MgH/efs_{}/ef_{}\".format(ef[i], vib[i]) for i in range(len(ef))], \n 'index':[wf[i] for i in range(len(wf))], 'normalize':True}\n filter_opes = [{'expeconly':{'name':'Multistate', 'states':WF_params['states'], 'unity':'False', 'header':\"mu{}\".format(ind)}, \n 'm{}'.format(ind):{'name':'GridPotential', 'file':'MgH/mu/mu_Sig0Sig1'}}\n for ind in [2.1,] ]\n #%%\n # Initialize\n prop = InpXML()\n prop.program('propa', propa_params, WF_params)\n prop.propagation('Cheby', H_params)\n prop.filter('filterpost', filter_opes)\n prop.show\n\n # Editing\n prop.hamilt = 'name', 'something'\n prop.hamilt = 'm0.0/T', 'name', 'something_new'\n prop.show\n \n # Writing to file\n # prop.writexml(filename='filename', txt=True)\n\nOut:\n```xml\n<qdng>\n <propa dt=\"1\" steps=\"1000\" dir=\"efs_g\" Nef=\"20\" conv=\"1e-11\">\n <propagator name=\"Cheby\">\n <hamiltonian name=\"Multistate\">\n <m0.0 name=\"Sum\">\n <T name=\"GridNablaSq\" mass=\"2000\" key=\"T\"/>\n <V name=\"GridPotential\" file=\"pot_Vg\"/>\n </m0.0>\n <m1.1 name=\"Sum\">\n <T ref=\"T\"/>\n <V name=\"GridPotential\" file=\"pot_Vg\"/>\n </m1.1>\n <m1.0 name=\"GridDipole\" file=\"mu\" laser=\"Et\"/>\n <m2.2 name=\"Sum\">\n <T ref=\"T\"/>\n <V name=\"GridPotential\" file=\"pot_Vg\"/>\n </m2.2>\n </hamiltonian>\n </propagator>\n <wf name=\"Multistate\" states=\"3\" normalize=\"true\">\n <wf1 file=\"MgH/efs_Sig0/ef_1\"/>\n </wf>\n <filterpost>\n <expeconly name=\"Multistate\" states=\"1\" unity=\"False\" header=\"mu2.1\">\n <m2.1 name=\"GridPotential\" file=\"MgH/mu/mu_Sig0Sig1\"/>\n </expeconly>\n </filterpost>\n </propa>\n</qdng>\n\n<qdng>\n <propa dt=\"1\" steps=\"1000\" dir=\"efs_g\" Nef=\"20\" conv=\"1e-11\">\n <propagator name=\"Cheby\">\n <hamiltonian name=\"something\">\n <m0.0 name=\"Sum\">\n <T name=\"something_new\" mass=\"2000\" key=\"T\"/>\n .\n .\n .\n```\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Create input files for QDng calculations",
"version": "0.0.415",
"project_urls": {
"Homepage": "https://gitlab.fysik.su.se/lucas.borges/pqinput"
},
"split_keywords": [
"qdng"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ba432edd761ae452bb3ed843d01d07d6a488eb6013674e17680de720a45b8002",
"md5": "d2a111b5d6b197a92bc30e166351c24b",
"sha256": "a48107dfadb40c4cb86c3c5bc0db312fd47c8af223bcd0404ec2b09e388f2319"
},
"downloads": -1,
"filename": "pqinput-0.0.415-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d2a111b5d6b197a92bc30e166351c24b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14437,
"upload_time": "2023-11-09T13:48:31",
"upload_time_iso_8601": "2023-11-09T13:48:31.429118Z",
"url": "https://files.pythonhosted.org/packages/ba/43/2edd761ae452bb3ed843d01d07d6a488eb6013674e17680de720a45b8002/pqinput-0.0.415-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1b48277ad54979cd704b57a33a88699a55fd52ff1df58b241277fde41ed06ebb",
"md5": "0cb21f6e0e3ac4093afcd2cbc6421342",
"sha256": "cec32004ec39de9b775b94daa9029f7c9c433f7d38b1877ce86c8ddfe620b657"
},
"downloads": -1,
"filename": "pqinput-0.0.415.tar.gz",
"has_sig": false,
"md5_digest": "0cb21f6e0e3ac4093afcd2cbc6421342",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14270,
"upload_time": "2023-11-09T13:48:37",
"upload_time_iso_8601": "2023-11-09T13:48:37.480262Z",
"url": "https://files.pythonhosted.org/packages/1b/48/277ad54979cd704b57a33a88699a55fd52ff1df58b241277fde41ed06ebb/pqinput-0.0.415.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-09 13:48:37",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pqinput"
}