Database

Class Methods

__init__([download_missing, use_cache, ...])

Create a new database instance with the given parameters.

get_global_database()

Return the global database instance if it was initialized, otherwise None.

initialize_global_database([...])

Initialize the global database with the given parameters.

class Database[source]

Class for a handling the databases for the pairinteraction package.

The Databases are used to store the atomic states, their energies, and their matrix elements to other states. The databases are stored in the user’s cache directory by default, but can be stored in a different directory. When running pairinteraction for the first time, the databases have to be downloaded from the internet (e.g. by explicitly passing download_missing=True to the constructor). Once the databases are downloaded, the user usually does not have to interact with the Database class directly.

__init__(download_missing=False, use_cache=True, database_dir='')[source]

Create a new database instance with the given parameters.

Parameters:
  • download_missing (bool) – Whether to download missing databases if needed. Default False.

  • use_cache (bool) – Whether to load the Wigner 3j symbols table into memory. Default True.

  • database_dir (Union[str, PathLike[str]]) – The directory where the databases are stored. Default “”, i.e. use the default directory (the user’s cache directory).

Return type:

None

classmethod get_global_database()[source]

Return the global database instance if it was initialized, otherwise None.

Return type:

Database

classmethod initialize_global_database(download_missing=False, use_cache=True, database_dir='')[source]

Initialize the global database with the given parameters.

The arguments are the same as for the constructor of this class.

Return type:

None

Parameters:
  • download_missing (bool)

  • use_cache (bool)

  • database_dir (str | PathLike[str])