IOM_plugin_wavepacket

About the IOM_plugin_wavepacket class

The WaveBlocks Project

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License

Class documentation

The WaveBlocks Project

IOM plugin providing functions for handling homogeneous Hagedorn wavepacket data.

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2016 R. Bourquin @license: Modified BSD License

IOM_plugin_wavepacket.add_wavepacket(self, parameters, timeslots=None, blockid=0, key=('q', 'p', 'Q', 'P', 'S'))[source]

Add storage for the homogeneous wavepackets.

Parameters:
  • parameters – An ParameterProvider instance with at least the keys dimension and ncomponents.
  • timeslots – The number of time slots we need. Can be set to None to get automatically growing datasets.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are q, p, Q, P, S and adQ. Default is ("q", "p", "Q", "P", "S").) – Specify which parameters to save. All are independent.
IOM_plugin_wavepacket.delete_wavepacket(self, blockid=0)[source]

Remove the stored wavepackets.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.has_wavepacket(self, blockid=0)[source]

Ask if the specified data block has the desired data tensor.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.load_wavepacket(self, timestep, blockid=0, key=('q', 'p', 'Q', 'P', 'S', 'adQ'))[source]

Load a wavepacket at a given timestep and return a fully configured instance. This method just calls some other IOManager methods in the correct order. It is included only for convenience and is not particularly efficient.

Parameters:
  • timestep – The timestep n at which we load the wavepacket.
  • key (Tuple of valid identifier strings that are q, p, Q, P, S and adQ. Default is ("q", "p", "Q", "P", "S", "adQ").) – Specify which parameters to load. All are independent.
  • blockid – The ID of the data block to operate on.
Returns:

A HagedornWavepacket instance.

IOM_plugin_wavepacket.load_wavepacket_basisshapes(self, the_hash=None, blockid=0)[source]

Load the basis shapes by hash.

Parameters:
  • the_hash – The hash of the basis shape whose description we want to load.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.load_wavepacket_coefficients(self, timestep=None, get_hashes=False, component=None, blockid=0)[source]

Load the wavepacket coefficients.

Parameters:
  • timestep – Load only the data of this timestep.
  • get_hashes – Return the corresponding basis shape hashes.
  • component – Load only data from this component.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.load_wavepacket_description(self, blockid=0)[source]

Load the wavepacket description.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.load_wavepacket_parameters(self, timestep=None, blockid=0, key=('q', 'p', 'Q', 'P', 'S'))[source]

Load the wavepacket parameters.

Parameters:
  • timestep – Load only the data of this timestep.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are q, p, Q, P, S and adQ. Default is ("q", "p", "Q", "P", "S").) – Specify which parameters to load. All are independent.
IOM_plugin_wavepacket.load_wavepacket_timegrid(self, blockid=0)[source]

Load the wavepacket timegrid.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.save_wavepacket(self, packet, timestep, blockid=None, key=('q', 'p', 'Q', 'P', 'S', 'adQ'))[source]

Save a wavepacket at a given timestep and read all data to save from the HagedornWavepacket instance provided. This method just calls some other IOManager methods in the correct order. It is included only for convenience and is not particularly efficient. We assume the wavepacket is already set up with the correct add_wavepacket() method call.

Parameters:
  • packet – The HagedornWavepacket instance we want to save.
  • timestep – The timestep n at which we save the wavepacket.
  • key (Tuple of valid identifier strings that are q, p, Q, P, S and adQ. Default is ("q", "p", "Q", "P", "S", "adQ").) – Specify which parameters to save. All are independent.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.save_wavepacket_basisshapes(self, basisshape, blockid=0)[source]

Save the basis shapes of the Hagedorn wavepacket to a file.

Parameters:
  • basisshape – The basis shape of the Hagedorn wavepacket.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.save_wavepacket_coefficients(self, coefficients, basisshapes, timestep=None, blockid=0)[source]

Save the coefficients of the Hagedorn wavepacket to a file. Warning: we do only save tha hash of the basis shapes here! You have to save the basis shape with the corresponding function too.

Parameters:
  • coefficients (A list with N suitable ndarrays.) – The coefficients of the Hagedorn wavepacket.
  • basisshapes (A list with N BasisShape subclass instances.) – The corresponding basis shapes of the Hagedorn wavepacket.
  • timestep – The timestep at which we save the data.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.save_wavepacket_description(self, descr, blockid=0)[source]

Save the description of this wavepacket.

Parameters:
  • descr – The description.
  • blockid – The ID of the data block to operate on.
IOM_plugin_wavepacket.save_wavepacket_parameters(self, parameters, timestep=None, blockid=0, key=('q', 'p', 'Q', 'P', 'S'))[source]

Save the parameter set \Pi of the Hagedorn wavepacket \Psi to a file.

Parameters:
  • parameters (A list containing the (five) ndarrays like (q,p,Q,P,S)) – The parameter set of the Hagedorn wavepacket.
  • timestep – The timestep at which we save the data.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are q, p, Q, P, S and adQ. Default is ("q", "p", "Q", "P", "S").) – Specify which parameters to save. All are independent.