Author Topic: Export QuantumEspresso input  (Read 5955 times)

0 Members and 1 Guest are viewing this topic.

Offline Jin You Lu

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: tw
  • Reputation: 1
    • View Profile
Export QuantumEspresso input
« 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
« Last Edit: March 19, 2018, 12:03 by Jin You Lu »

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Export QuantumEspresso input
« Reply #1 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.
« Last Edit: March 28, 2018, 13:46 by Petr Khomyakov »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Export QuantumEspresso input
« Reply #2 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"))

Offline Petr Khomyakov

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1290
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Export QuantumEspresso input
« Reply #3 on: April 9, 2018, 11:29 »
I confirm that it works in QuantumATK-2017.12.