IOM_plugin_lincombhawp

About the IOM_plugin_lincombhawp 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 linear combinations of Hagedorn wavepackets.

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

IOM_plugin_lincombhawp.add_lincombhawp(self, parameters, timeslots=None, lincombsize=None, wavepacketsize=None, blockid=0, key=('q', 'p', 'Q', 'P', 'S'))[source]

Add storage for the linear combination of Hagedorn 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.
  • lincombsize – The (maximal) size J of the linear combination of wavepackets. If specified this remains fixed for all timeslots. Can be set to None (default) to get automatically growing datasets.
  • wavepacketsize – The (maximal) basis shape size K of each of the wavepackets. If specified this remains fixed for all timeslots. Can be set to None (default) 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_lincombhawp.delete_lincombhawp(self, blockid=0)[source]

Remove the stored linear combination.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.has_lincombhawp(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_lincombhawp.load_lincombhawp(self, timestep, blockid=0, key=('q', 'p', 'Q', 'P', 'S'))[source]

Load a linear combination at a given timestep and return a fully configured LinearCombinationOfHAWPs 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 we load the wavepacket.
  • blockid – The ID of the data block to operate on.
Returns:

A LinearCombinationOfHAWPs instance.

IOM_plugin_lincombhawp.load_lincombhawp_coefficients(self, timestep=None, blockid=0)[source]

Load the coefficients of this linear combination.

Parameters:
  • timestep – Load only the data of this timestep.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.load_lincombhawp_description(self, blockid=0)[source]

Load the description of this linear combination.

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.load_lincombhawp_size(self, timestep=None, blockid=0)[source]

Load the size (number of packets) of this linear combination.

Parameters:
  • timestep – Load only the data of this timestep.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.load_lincombhawp_timegrid(self, blockid=0, key=('coeffs', 'packets'))[source]

Load the timegrid of this linear combination.

Parameters:
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are ceoffs and packets. Default is ("coeffs", "packets").) – Specify which linear combination timegrids to load. All are independent.
IOM_plugin_lincombhawp.load_lincombhawp_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_lincombhawp.load_lincombhawp_wavepacket_coefficients(self, timestep=None, get_hashes=False, blockid=0)[source]

Load the wavepacket coefficients.

Parameters:
  • timestep – Load only the data of this timestep.
  • get_hashes – Return the corresponding basis shape hashes.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.load_lincombhawp_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_lincombhawp.save_lincombhawp(self, lincomb, timestep, blockid=0)[source]

Save a linear combination of Hagedorn wavepackets at a given timestep and read all data to save from the LinearCombinationOfHAWPs 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 linear combination is already set up with the correct add_lincombhawp() method call.

Parameters:
  • lincomb – The LinearCombinationOfHAWPs instance we want to save.
  • timestep – The timestep n at which we save the linear combination.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.save_lincombhawp_coefficients(self, coefficients, timestep, blockid=0)[source]

Save the coefficients of the linear combination to a file.

Parameters:
  • coefficients (A single, suitable ndarray.) – The coefficients of the linear combination of wavepackets.
  • timestep – The timestep at which we save the data.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.save_lincombhawp_description(self, descr, blockid=0)[source]

Save the description of this linear combination.

Parameters:
  • descr – The description.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.save_lincombhawp_wavepacket_basisshapes(self, basisshapes, blockid=0)[source]

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

Parameters:
  • basisshapes – A list of the basis shapes of the linear combination.
  • blockid – The ID of the data block to operate on.
IOM_plugin_lincombhawp.save_lincombhawp_wavepacket_coefficients(self, coefficients, basisshapes, timestep=None, blockid=0)[source]

Save the coefficients of the Hagedorn wavepacket linear combination 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_lincombhawp.save_lincombhawp_wavepacket_parameters(self, parameters, timestep, 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.