pymolpro (version 1.8.1)
pymolpro is a Python library that provides support for working with the Molpro quantum chemistry package.
The principal feature is
the Project()
class that provides access to a complete Molpro job, including input
and output files together with metadata such as job status information.
The project is stored as a bundle implemented as a directory in the file system.
The class is a Python binding of the
sjef library with additional Molpro-specific customisation,
and the project bundle can be accessed
also through a command-line interface and the gmolpro
graphical user interface.
For technical reasons, Project()
invokes the submodular class pymolpro.project.Project()
.
Normally all that is required to instantiate a class, on either a new or existing bundle,
is to pass a single argument which is the path of the bundle, with or without the compulsory
suffix .molpro.
Simply running Molpro and inspecting the output can be achieved as:
from pymolpro import Project
p=Project("Neon")
p.write_input("""
geometry={Ne}
rhf
ccsd(t)
""")
p.run()
print(p.out)
Normally, pymolpro.project.Project.run()
launches the job in the background, potentially on a remote machine via a suitably configured backend,
and its status is available through the pymolpro.project.Project.status
attribute.
Additionally, the job launching request is ignored if the project has already run the job successfully using the same input; this introduces the convenience of being able to re-run an entire workflow, for example in a Jupyter notebook, without needless recomputation.
Molpro produces an xml file that contains all the essential results, marked up using the molpro-output schema.
The pymolpro Project class contains functions that interpret that output, and at the lowest level this can be
achieved through a suitable XPath search.
For extracting calculated properties, including energies, convenience functions
pymolpro.project.Project.properties()
,
pymolpro.project.Project.energies()
,
that wrap
suitable XPath searches, are provided.
These functions can return either a Python dictionary containing all information about the property, or just its value.
The following is a simple example where a job is created, run and
analysed.:
from pymolpro import Project
p = Project("Neon")
p.write_input("geometry={Ne}; rhf; ccsd(t)")
p.run(wait=True)
assert p.status == 'completed' and not p.errors()
energies = {}
for node in p.xpath("//property[@name='Energy' or @name='total energy']"):
energies[node.xpath("@method")[0]] = float(node.xpath("@value")[0])
energy_values = p.energies()
all_principal_properties_dict = p.properties(principal=True, dict=True)
final_energy = p.energy(method='CCSD(T)')
Installation
pymolpro is on conda forge and can be installed on most systems using conda install -c conda-forge pymolpro
.
On Microsoft Windows, you need to also install msys2,
and then, in an msys command window, pacman -S rsync openssh
.
For a complete set-up of pymolpro within Jupyter notebooks driven from the comand line on linux or macOS,
Install Molpro
Install Miniconda. On macOS with homebrew, this can be done with
brew install miniconda
. You may need to then typeconda init
and restart the shell.Create a conda environment to contain at least these packages; of course you can add any others you need, e.g.
matplotlib
:conda create -n pymolpro-jupyter -c conda-forge pymolpro jupyter nb_conda_kernels
.If you intend to run Molpro jobs on a remote machine, set up password-free ssh access to it, using the following or otherwise:
ssh-keygen; ssh-copy-id
user@host. Then edit the file~/.sjef/molpro/backends.xml
to specify the backend.Activate the environment:
conda activate pymolpro-jupyter
. To create a new notebook,jupyter notebook
; to open an existing notebookjupyter notebook existing_file.ipynb
For a complete set-up of pymolpro within Jupyter notebooks on Windows,
Install Molpro, and msys2 as described above.
Install Anaconda3
Open Anaconda Navigator
Select the
Environments
tab and press theCreate
button. Give your new conda environment a name, e.g.pymolpro-jupyter
.With the
Channels
button, add theconda-forge
channel, and then selectNot installed
and search for, and installpymolpro
,jupyter
,nb_conda_kernels
, as well as any other packages you might want, such asmatplotlib
.If you intend to run Molpro jobs on a remote machine, from the command menu run
MSYS2
, and (a) create a password-free ssh key by runningssh-keygen
; (b) authorize that key for login on the desired remote machine:ssh-copy-id
user@host; (c) edit the file.sjef\molpro\backends.xml
(relative to your Windows home directory) to specify the backend.Select the
Home
tab and run the Jupyter Notebook application, ensuring that the selected environment ispymolpro-jupyter
.
- pymolpro
- Database library
- Bak2000 atomisations
- Bak2000 reactions
- GMTKN30 BHPERI
- GMTKN30 DARC
- GMTKN30 DC9
- GMTKN30 O3ADD6
- GMTKN55 ACONF
- GMTKN55 ADIM6
- GMTKN55 AHB21
- GMTKN55 AL2X6
- GMTKN55 ALK8
- GMTKN55 ALKBDE10
- GMTKN55 Amino20x4
- GMTKN55 BH76
- GMTKN55 BH76RC
- GMTKN55 BHDIV10
- GMTKN55 BHPERI
- GMTKN55 BHROT27
- GMTKN55 BSR36
- GMTKN55 BUT14DIOL
- GMTKN55 C60ISO
- GMTKN55 CARBHB12
- GMTKN55 CDIE20
- GMTKN55 CHB6
- GMTKN55 DARC
- GMTKN55 DC13
- GMTKN55 DIPCS10
- GMTKN55 FH51
- GMTKN55 G21EA
- GMTKN55 G21IP
- GMTKN55 G2RC
- GMTKN55 HAL59
- GMTKN55 HEAVY28
- GMTKN55 HEAVYSB11
- GMTKN55 ICONF
- GMTKN55 IDISP
- GMTKN55 IL16
- GMTKN55 INV24
- GMTKN55 ISO34
- GMTKN55 ISOL24
- GMTKN55 MB16-43
- GMTKN55 MCONF
- GMTKN55 NBPRC
- GMTKN55 PA26
- GMTKN55 PArel
- GMTKN55 PCONF21
- GMTKN55 PNICO23
- GMTKN55 PX13
- GMTKN55 RC21
- GMTKN55 RG18
- GMTKN55 RSE43
- GMTKN55 S22
- GMTKN55 S66
- GMTKN55 SCONF
- GMTKN55 SIE4x4
- GMTKN55 TAUT15
- GMTKN55 UPU23
- GMTKN55 W4-11
- GMTKN55 WATER27
- GMTKN55 WCPT18
- GMTKN55 YBDE18
- Karton CRBH20
- Minnesota 2019 2pIsoE4
- Minnesota 2019 3dEE8
- Minnesota 2019 4dAEE5
- Minnesota 2019 4pIsoE4
- Minnesota 2019 ABDE13
- Minnesota 2019 AE17
- Minnesota 2019 AEE15
- Minnesota 2019 AL2X6
- Minnesota 2019 ASNC2
- Minnesota 2019 BHDIV10
- Minnesota 2019 BHPERI26
- Minnesota 2019 BHROT27
- Minnesota 2019 DC9
- Minnesota 2019 DGH4
- Minnesota 2019 DGL6
- Minnesota 2019 DIPCS10
- Minnesota 2019 DM79
- Minnesota 2019 EA13
- Minnesota 2019 EE23
- Minnesota 2019 EE69
- Minnesota 2019 EEA11
- Minnesota 2019 EEAroT5
- Minnesota 2019 EER5
- Minnesota 2019 HC7
- Minnesota 2019 HEAVYSB11
- Minnesota 2019 HTBH38
- Minnesota 2019 IP23
- Minnesota 2019 ISOL6
- Minnesota 2019 LRCTEE2
- Minnesota 2019 LRCTEE9
- Minnesota 2019 MR-MGM-BE4
- Minnesota 2019 MR-MGN-BE17
- Minnesota 2019 MR-TM-BE12
- Minnesota 2019 MR-TMD-BE3
- Minnesota 2019 NCCE30
- Minnesota 2019 NGD21
- Minnesota 2019 NHTBH38
- Minnesota 2019 NaCl
- Minnesota 2019 PA8
- Minnesota 2019 PX13
- Minnesota 2019 S66 0.90
- Minnesota 2019 S66 0.95
- Minnesota 2019 S66 1.00
- Minnesota 2019 S66 1.05
- Minnesota 2019 S66 1.10
- Minnesota 2019 S66 1.25
- Minnesota 2019 S66 1.50
- Minnesota 2019 S66 2.00
- Minnesota 2019 S66 A
- Minnesota 2019 S66 B
- Minnesota 2019 SIE4x4
- Minnesota 2019 SMAE3
- Minnesota 2019 SR-MGM-BE8
- Minnesota 2019 SR-MGN-BE107
- Minnesota 2019 SR-TM-BE15
- Minnesota 2019 TMBH22
- Minnesota 2019 TMDBL10
- Minnesota 2019 TSG48
- Minnesota 2019 WCCR10
- Minnesota 2019 YBDE18
- Minnesota 2019 pEE5
- Minnesota 2019 pTC13
- Weizmann W411 BDE 99
- Weizmann W411 HAT 707
- Weizmann W411 ISOMERIZATION 20
- Weizmann W411 SN 13
- Weizmann W411 TAE 140
- Weizmann W411 TAE MR 16
- Weizmann W411 TAEnonMR 124
- benchmarks N2minimal
- sample
- Examples
- Non-covalent interactions benchmark
- Potential energy surface for twisting of ethene
- Evaluate charge density at the atomic nuclei
- Optimise and view the structure of ammonia dimer
- Extract results held in Molpro variables
- Monitor progress of geometry optimisation
- Generation and use of an orbital-based grid
- Extract pair correlation energies
- Thermochemical benchmark: atomisation of closed shell molecules with core correlation
- Thermochemical Benchmark: closed shell reactions with core correlation