QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: jalmeida on March 30, 2023, 11:17

Title: QuantumATK doesn't read optimized structure
Post by: jalmeida on March 30, 2023, 11:17
Dear all,

Please, I am trying to read the optimized structure of a junction but doesn't work. The part of the code is bellow:

device_configuration = nlread(filename='/home/jalmeida/MyProjects/junction/opt.hdf5',
                                                    class_type=DeviceConfiguration,
                                                    object_id='optimizedeviceconfiguration')

However, I got the error:

NL.ComputerScienceUtilities.Exceptions.NLTypeError: The parameter 'configuration' must be an instance of one of the following: MoleculeConfiguration, BulkConfiguration, SurfaceConfiguration, DeviceConfiguration.

The image of the objects is attached. probably I need to declare somehow the 'Optimized Configuration' to describe well where my DeviceConfiguration is. Thanks in advance!

Have a nice day,
SANTOS ALMEIDA, Joseane.
Title: Re: QuantumATK doesn't read optimized structure
Post by: Anders Blom on March 30, 2023, 21:05
Most likely you just need to add [-1] to the end of the nlread (after the closing parenthesis).
nlread always returns a list, even if it only reads one object from the file, in order to have a consistent API.
Title: Re: QuantumATK doesn't read optimized structure
Post by: jalmeida on March 31, 2023, 09:47
Thanks for your reply. Unfortunately it didn't work. I tried 0, 1, -1, -2 just to check and all of them gives the error "IndexError: list index out of range". 
Title: Re: QuantumATK doesn't read optimized structure
Post by: Anders Blom on April 3, 2023, 19:54
In that case the list returned by nlread is empty, meaning no object was found in the file matching the criteria you provided.
Title: Re: QuantumATK doesn't read optimized structure
Post by: jalmeida on April 5, 2023, 17:26
All right. Since I tried different ways without success, the solution that I found was drop it in the builder and save the coordinates of optimized structure to do one scf calculation that I can use the hdf5 file later. Thank you for your reply!