qnm.schwarzschild.tabulated¶
Computing, loading, and storing tabulated Schwarzschild QNMs.
Functions
build_Schw_dict (\*args, \*\*kwargs) |
Function to build a dict of Schwarzschild QNMs. |
default_pickle_file () |
Give the default path of the QNM dict pickle file, <dirname of this file>/data/Schw_dict.pickle. |
Classes
QNMDict ([init, dict_pickle_file]) |
Object for getting/holding/(pre-)computing Schwarzschild QNMs. |
-
class
qnm.schwarzschild.tabulated.
QNMDict
(init=False, dict_pickle_file=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qnm/checkouts/stable/qnm/schwarzschild/data/Schw_dict.pickle'))[source]¶ Object for getting/holding/(pre-)computing Schwarzschild QNMs.
This class uses the “borg” pattern, so the table of precomputed values will be shared amongst all instances of the class. A set of precomputed QNMs can be loaded/stored from a pickle file with
load_dict()
andwrite_dict()
. The main interface is via the special__call__()
method which is invoked via object(s,l,n). If the QNM labeled by (s,l,n) has already been computed, it will be returned. Otherwise we try to compute it and then return it.Parameters: - init: bool, optional [default: False]
Whether or not to call
load_dict()
when initializing this instance.- dict_pickle_file: string or Path, optional [default: from default_pickle_file()]
Path to pickle file that holds precomputed QNMs. If the value is None, get the default from
default_pickle_file()
.
Attributes: - seq_dict: dict
Keys are tuples (s,l) which label an overtone sequence of QNMs. Values are instances of
qnm.schwarzschild.overtonesequence.SchwOvertoneSeq
.- loaded_from_disk: bool
Whether or not any modes have been loaded from disk
Methods
__call__
(self, s, l, n)Get the Schwarzschild QNM labeled by (s,l,n). load_dict
(self[, dict_pickle_file])Load a Schw QNM dict from disk. write_dict
(self[, dict_pickle_file])Write the current state of the QNM dict to disk. -
__call__
(self, s, l, n)[source]¶ Get the Schwarzschild QNM labeled by (s,l,n).
If the QNM has already been computed, immediately return that value. If the (s,l) sequence is in the dict, but n has not been computed, extend the sequence to n and return the QNM. If the (s,l) sequence is not already in the dict, add it to the dict out to overtone n.
Parameters: - s: int
Spin weight of the field.
- l: int
Multipole number of the QNM.
- n: int
Overtone number of the QNM.
Returns: - (complex, double, int)
The complex value is the QNM frequency. The double is the estimated truncation error for the continued fraction. The int is the depth of the continued fraction evaluation.
Raises: - TODO
-
load_dict
(self, dict_pickle_file=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qnm/checkouts/stable/qnm/schwarzschild/data/Schw_dict.pickle'))[source]¶ Load a Schw QNM dict from disk.
Parameters: - dict_pickle_file: string or Path [default: from default_pickle_file()]
Filename for reading (or writing) dict of Schwarzschild QNMs
-
loaded_from_disk
= False¶
-
write_dict
(self, dict_pickle_file=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/qnm/checkouts/stable/qnm/schwarzschild/data/Schw_dict.pickle'))[source]¶ Write the current state of the QNM dict to disk.
Parameters: - dict_pickle_file: string [default: from default_pickle_file()]
Filename for reading (or writing) dict of Schwarzschild QNMs
-
qnm.schwarzschild.tabulated.
build_Schw_dict
(*args, **kwargs)[source]¶ Function to build a dict of Schwarzschild QNMs.
Loops over values of (s,l), using SchwOvertoneSeq to find sequences in n.
TODO Documentation
Parameters: - s_arr: [int] [default: [-2, -1, 0]]
Array of s values to run over.
- n_max: int [default: 20]
Maximum overtone number to run over (inclusive).
- l_max: int [default: 20]
Maximum angular harmonic number to run over (inclusive).
- tol: float [default: 1e-10]
Tolerance to pass to SchwOvertoneSeq.
Returns: - dict
A dict with tuple keys (s,l,n). The value at d[s,l,n] is a tuple (omega, cf_err, n_frac) where omega is the frequency omega_{s,l,n}, cf_err is the estimated truncation error for the continued fraction, and n_frac is the depth of the continued fraction evaluation.