dynamite.config¶
The dynamite._Config
class is instantiated by dynamite
as dynamite.config
. This is the object on which one should call
these functions. For example:
from dynamite import config
config.initialize(['-mfn_ncv','20'])
config.L = 24
- class dynamite._Config[source]¶
Package-wide configuration of dynamite.
- initialize(slepc_args=None, version_check=True, gpu=None)[source]¶
Initialize PETSc/SLEPc with various arguments (which would be passed on the command line for a C program).
Only the first call to this function has any effect. It is automatically called when using much of the PETSc/SLEPc functionality (including importing petsc4py.PETSc or slepc4py.SLEPc), so it must be called early (probably right after importing dynamite).
- Parameters:
slepc_args (list of str) – The arguments to SLEPc initialization.
version_check (bool) – Whether process 0 should check for a new dynamite version on initialization. Can be set to false if the check is unnecessary or causes problems.
gpu (bool) – Whether to run all computations using a GPU instead of the CPU.
- property L¶
A global spin chain length that will be applied to all matrices and states, unless they are explicitly set to a different size. Is not retroactive— will not set the size for any objects that have already been created.
- property shell¶
Whether to use standard PETSc matrices (
False
, default), or shell matrices (True
).
- property subspace¶
The subspace to use for all operators and states. Can also be set for individual operators and states–see
dynamite.operators.Operator.subspace
for details.
- property gpu¶
Whether to run the computations on a GPU. This property is read-only. To use GPUs,
initialize()
must be called withgpu=True
(default when built with GPU support).