Restore - Maple Help

QuantumChemistry

 Restore
 restore a session previously saved by the package's Save command

 Calling Sequence Restore() Restore(file)

Parameters

 file - string; string of the filename ending in .m containing saved session data

Description

 • The Save command saves to a Maple .m file the remember (cache) tables used by the package to remember previously computed data, and the Restore command restores these tables from a Maple .m file.
 • The remember (cache) tables are used by the Quantum Chemistry package to retrieve data from calculations without recomputation.  For example, after the energy of a molecule is computed by the Energy command with a given method and its options, the same command or other commands with the same options can generate properties or plots without reperforming the electronic structure calculation.  The Save and Restore commands allow this useful behavior to be saved and restored between Maple sessions.  The created files are compatible across different computers and even different operating systems, allowing the user to switch computers or operating systems.  The commands can also be used to switch between different Maple interfaces to the Quantum Chemistry package including the worksheet, document, interactive (Maplet), and command line interfaces.
 • Because cache tables are cleared when they reach a prescribed size, it is possible that some calculations may need to be recomputed if some of the early cache in a long, memory-intensive session was cleared.
 • These commands do not save the user's variables in a session; if desired, such variables can be saved using the save command.
 • The Restore() command without a parameter opens a file dialogue for selecting the .m file.
 • The Restore(file) command with the string parameter file opens the file named file.m.
 • The string file requires the file's full path if the file is not located in Maple's current working directory, i.e. on Linux or MacOS the file might be "/home/john/ozone.m" or on Windows 64 bit it might be "C:/Users/John/Documents/ozone.m".
 • If the string file does not end in .m, the command will automatically append a ".m" to the given string.
 • The Maple command currentdir can be used to change the current working directory of the Maple session.  Changing the current directory to "/home/john/" on Linux or MacOS, for example, would allow us to set file to "ozone.m" without the file's full path.

Examples

 > $\mathrm{with}\left(\mathrm{QuantumChemistry}\right):$

We obtain the molecular geometry of aspirin with the MolecularGeometry command

 >
 ${\mathrm{molecule}}{≔}\left[\left[{"O"}{,}{1.23330000}{,}{0.55400000}{,}{0.77920000}\right]{,}\left[{"O"}{,}{-0.69520000}{,}{-2.71480000}{,}{-0.75020000}\right]{,}\left[{"O"}{,}{0.79580000}{,}{-2.18430000}{,}{0.86850000}\right]{,}\left[{"O"}{,}{1.78130000}{,}{0.81050000}{,}{-1.48210000}\right]{,}\left[{"C"}{,}{-0.08570000}{,}{0.60880000}{,}{0.44030000}\right]{,}\left[{"C"}{,}{-0.79270000}{,}{-0.55150000}{,}{0.12440000}\right]{,}\left[{"C"}{,}{-0.72880000}{,}{1.84640000}{,}{0.41330000}\right]{,}\left[{"C"}{,}{-2.14260000}{,}{-0.47410000}{,}{-0.21840000}\right]{,}\left[{"C"}{,}{-2.07870000}{,}{1.92380000}{,}{0.07060000}\right]{,}\left[{"C"}{,}{-2.78550000}{,}{0.76360000}{,}{-0.24530000}\right]{,}\left[{"C"}{,}{-0.14090000}{,}{-1.85360000}{,}{0.14770000}\right]{,}\left[{"C"}{,}{2.10940000}{,}{0.67150000}{,}{-0.31130000}\right]{,}\left[{"C"}{,}{3.53050000}{,}{0.59960000}{,}{0.16350000}\right]{,}\left[{"H"}{,}{-0.18510000}{,}{2.75450000}{,}{0.65930000}\right]{,}\left[{"H"}{,}{-2.72470000}{,}{-1.36050000}{,}{-0.45640000}\right]{,}\left[{"H"}{,}{-2.57970000}{,}{2.88720000}{,}{0.05060000}\right]{,}\left[{"H"}{,}{-3.83740000}{,}{0.82380000}{,}{-0.50900000}\right]{,}\left[{"H"}{,}{3.72900000}{,}{1.41840000}{,}{0.85930000}\right]{,}\left[{"H"}{,}{4.20450000}{,}{0.69690000}{,}{-0.69240000}\right]{,}\left[{"H"}{,}{3.71050000}{,}{-0.36590000}{,}{0.64260000}\right]{,}\left[{"H"}{,}{-0.25550000}{,}{-3.59160000}{,}{-0.73370000}\right]\right]$ (1)

We run a Variational2RDM calculation on the molecule with a [10,10] active space

 >
 ${\mathrm{table}}{}\left({\mathrm{%id}}{=}{18446745072056524158}\right)$ (2)

We can save the data (cache tables) of this session

 > $\mathrm{Save}\left(\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{kernelopts}\left(\mathrm{homedir}\right),"aspirin_session.m"\right]\right)\right);$

Now we restart the Maple kernel which removes all data

 > $\mathrm{restart};$

 > $\mathrm{with}\left(\mathrm{QuantumChemistry}\right):$

we can restore the previous Quantum Chemistry session with the Restore command

 > $\mathrm{Restore}\left(\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{kernelopts}\left(\mathrm{homedir}\right),"aspirin_session.m"\right]\right)\right);$

Now we can execute the Variational2RDM command or another command using the same method and options without recomputation (note that the command executes instantly)

 >
 ${\mathrm{molecule}}{≔}\left[\left[{"O"}{,}{1.23330000}{,}{0.55400000}{,}{0.77920000}\right]{,}\left[{"O"}{,}{-0.69520000}{,}{-2.71480000}{,}{-0.75020000}\right]{,}\left[{"O"}{,}{0.79580000}{,}{-2.18430000}{,}{0.86850000}\right]{,}\left[{"O"}{,}{1.78130000}{,}{0.81050000}{,}{-1.48210000}\right]{,}\left[{"C"}{,}{-0.08570000}{,}{0.60880000}{,}{0.44030000}\right]{,}\left[{"C"}{,}{-0.79270000}{,}{-0.55150000}{,}{0.12440000}\right]{,}\left[{"C"}{,}{-0.72880000}{,}{1.84640000}{,}{0.41330000}\right]{,}\left[{"C"}{,}{-2.14260000}{,}{-0.47410000}{,}{-0.21840000}\right]{,}\left[{"C"}{,}{-2.07870000}{,}{1.92380000}{,}{0.07060000}\right]{,}\left[{"C"}{,}{-2.78550000}{,}{0.76360000}{,}{-0.24530000}\right]{,}\left[{"C"}{,}{-0.14090000}{,}{-1.85360000}{,}{0.14770000}\right]{,}\left[{"C"}{,}{2.10940000}{,}{0.67150000}{,}{-0.31130000}\right]{,}\left[{"C"}{,}{3.53050000}{,}{0.59960000}{,}{0.16350000}\right]{,}\left[{"H"}{,}{-0.18510000}{,}{2.75450000}{,}{0.65930000}\right]{,}\left[{"H"}{,}{-2.72470000}{,}{-1.36050000}{,}{-0.45640000}\right]{,}\left[{"H"}{,}{-2.57970000}{,}{2.88720000}{,}{0.05060000}\right]{,}\left[{"H"}{,}{-3.83740000}{,}{0.82380000}{,}{-0.50900000}\right]{,}\left[{"H"}{,}{3.72900000}{,}{1.41840000}{,}{0.85930000}\right]{,}\left[{"H"}{,}{4.20450000}{,}{0.69690000}{,}{-0.69240000}\right]{,}\left[{"H"}{,}{3.71050000}{,}{-0.36590000}{,}{0.64260000}\right]{,}\left[{"H"}{,}{-0.25550000}{,}{-3.59160000}{,}{-0.73370000}\right]\right]$ (3)
 >
 ${\mathrm{table}}{}\left({\mathrm{%id}}{=}{18446745071785926014}\right)$ (4)
 >