QuantumATK Forum

QuantumATK => Scripts, Tutorials and Applications => Topic started by: Jin You Lu on March 19, 2018, 08:31

Title: Export QuantumEspresso input
Post by: Jin You Lu on March 19, 2018, 08:31
Dear Sir

I have around 80 cif files, and I am wondering if it is possible to generate the quantumespresso input files efficiently by using script.

which may be similar to
BulkConfiguration=nlread("ZZZSSY01.cif")

Export???(("ZZZSSY01.in",BulkConfiguration)

Thank you so much
Title: Re: Export QuantumEspresso input
Post by: Petr Khomyakov on March 28, 2018, 13:40
You can certainly nlread the cif-files in a loop and save the structures as bulk configurations to an hdf5 file, so that the configurations will be accessible on the LabFloor or later for post-processing through QuantumATK scripting.

# Read a cif file as a bulk configuration
bulk_configuration=nlread("filename_configuration.cif", BulkConfiguration)[0]
# Print the bulk configuration to the log file, if needed
nlprint(bulk_configuration)
# Save the bulk configuration as an object in an hdf5-file (all the objects then appear on the LabFloor)
nlsave("filename_all_configurations.hdf5", bulk_configuration)

However, I am not aware of a straightforward Export option to create an 'filename_configuration.in' file of QE through scripting.
Title: Re: Export QuantumEspresso input
Post by: Anders Blom on April 5, 2018, 04:30
Try this

Code: python
from AddOns.QuantumEspressoPlugins.InputFilters.QuantumEspressoExporter import QuantumEspressoExporter
qe_exporter = QuantumEspressoExporter()
cif_file = "filename_configuration.cif"
bulk_configuration=nlread(cif_file, BulkConfiguration)[0]
qe_exporter.export(bulk_configuration, cif_file.replace(".cif",".in"))
Title: Re: Export QuantumEspresso input
Post by: Petr Khomyakov on April 9, 2018, 11:29
I confirm that it works in QuantumATK-2017.12.