# Restarting the QE calculations using the retrieved charge density

**URL:** <https://aiida.discourse.group/t/restarting-the-qe-calculations-using-the-retrieved-charge-density/606>\
**Category:** General Usage\
**Tags:** question, aiida\
**Created:** [April 27, 2025, 7:29am UTC](https://aiida.discourse.group/t/restarting-the-qe-calculations-using-the-retrieved-charge-density/606 "2025-04-27T07:29:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abmazitov](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/abmazitov/32/309_2.png) [@abmazitov](https://aiida.discourse.group/u/abmazitov)\
**Post date:** [April 27, 2025, 7:29am UTC](https://aiida.discourse.group/t/restarting-the-qe-calculations-using-the-retrieved-charge-density/606/1 "2025-04-27T07:29:01Z")

</div>

Dear Users/Developers,

I’m trying to find a way to restart the QE calculation using the saved charge densities file. In the parent calculation, it was gzipped and stored by setting the filename in the `additional_retrieve_list`. I’d like to make a fully automated restart by uploading the charge densities back to the HPC cluster and providing it in the new calculation inputs. Is there a way to do it in AIIDA? Many thanks for your help in advance! 🙏

---

<div class="post-metadata">

**Author:** ![t-reents](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/t-reents/32/82_2.png) [@t-reents](https://aiida.discourse.group/u/t-reents)\
**Post date:** [April 29, 2025, 8:55am UTC](https://aiida.discourse.group/t/restarting-the-qe-calculations-using-the-retrieved-charge-density/606/2 "2025-04-29T08:55:15Z")

</div>

Hi @abmazitov

sorry for the delayed reply!

Yes, you can. A `PwCalculation` supports the `parent_folder` input which copies the content of an existing remote folder to the new directory to do the restart. However, your files are not on the remote anymore but rather in your local file repository. Hence, you would first need to upload it and create the corresponding `RemoteData`. In order to keep track of the provenance, you can use the `TransferCalculation`: [How to work with data — AiiDA 2.6.3 documentation](https://aiida.readthedocs.io/projects/aiida-core/en/stable/howto/data.html#transferring-data).

1. Use the `TransferCalculation` to upload the charge density from the retrieved `FolderData` of your existing QE calculations. You should ensure that the charge density is copied into the correct directory structure, which mimics the one of a QE calculation, i.e., into the `out` sub directory ([aiida-quantumespresso/src/aiida\_quantumespresso/calculations/\_\_init\_\_.py at main · aiidateam/aiida-quantumespresso · GitHub](https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/calculations/ __init__.py#L288-L293))
2. Use the created `RemoteData` as the `parent_folder` input of the `PwCalculation` for your restarts.
3. You should of course also adjust the corresponding parameters in QE to do a restart.

Just as a comment for the future. Another useful concept that we use ourselves for the exact same purpose is stashing: [Usage — AiiDA 2.6.3 documentation](https://aiida.readthedocs.io/projects/aiida-core/en/stable/topics/calculations/usage.html#stashing-on-the-remote)  
In that case, you can just store the files on the remote, but in a more long term location. This avoids the necessity of retrieving and locally storing large files.

Finally, since you zipped the files, you could add a command to unzip in the `prepend_text` (just as a comment, but probably you already know how to do it as you also zipped it previously).

This would be the general outline. I hope this helps, but don’t hesitate to reach out again in case you encounter any problems.
