Class Context¶
Defined in File context.hpp
Nested Relationships¶
Nested Types¶
Class Documentation¶
-
class Context¶
Specifies second quantization context, such as vacuum choice, whether index spaces are orthonormal, sizes of index spaces, etc.
Public Functions
standard full-form constructor
- Parameters:
isr_sptr – a shared_ptr to an IndexSpaceRegistry object
vac – a Vacuum object
m – an IndexSpaceMetric object
bks – a BraKetSymmetry object
spb – single-particle basis (spin-free or spin-dependent)
fdio – first dummy index ordinal
-
explicit Context(IndexSpaceRegistry isr, Vacuum vac = Defaults::vacuum, IndexSpaceMetric m = Defaults::metric, BraKetSymmetry bks = Defaults::braket_symmetry, SPBasis spb = Defaults::spbasis, std::size_t fdio = Defaults::first_dummy_index_ordinal)¶
same as the standard ctor, using IndexSpaceRegistry passed by value
- Parameters:
isr – an IndexSpaceRegistry object
vac – a Vacuum object
m – an IndexSpaceMetric object
bks – a BraKetSymmetry object
spb – single-particle basis (spin-free or spin-dependent)
fdio – first dummy index ordinal
-
explicit Context(Vacuum vac, IndexSpaceMetric m = Defaults::metric, BraKetSymmetry bks = Defaults::braket_symmetry, SPBasis spb = Defaults::spbasis, std::size_t fdio = Defaults::first_dummy_index_ordinal)¶
same as the standard ctor, using default-constructed IndexSpaceRegistry
- Parameters:
vac – a Vacuum object
m – an IndexSpaceMetric object
bks – a BraKetSymmetry object
spb – single-particle basis (spin-free or spin-dependent)
fdio – first dummy index ordinal
-
Context() = default¶
default constructor, equivalent to Context(Vacuum::Physical,
IndexSpaceMetric::Unit, BraKetSymmetry::conjugate,
sequant::SPBasis::spinorbital, 100)
Warning
default constructor does not create an IndexSpaceRegistry, thus
this->index_space_registry()
will return nullptr
-
~Context() = default¶
-
std::shared_ptr<const IndexSpaceRegistry> index_space_registry() const¶
Warning
can be null when user did not provide one to Context (i.e., it was default constructed)
- Returns:
a constant pointer to the IndexSpaceRegistry for this context
-
std::shared_ptr<IndexSpaceRegistry> mutable_index_space_registry() const¶
- Throws:
std::logic_error – if the IndexSpaceRegistry is null
- Returns:
a pointer to the IndexSpaceRegistry for this context.
-
IndexSpaceMetric metric() const¶
- Returns:
IndexSpaceMetric of this context
-
BraKetSymmetry braket_symmetry() const¶
- Returns:
BraKetSymmetry of this context
-
std::size_t first_dummy_index_ordinal() const¶
- Returns:
first ordinal of the dummy indices generated by calls to Index::next_tmp_index when this context is active
-
Context &set(Vacuum vacuum)¶
Sets the Vacuum for this context, convenient for chaining
- Parameters:
vacuum – Vacuum
- Returns:
ref to
*this
, for chaining
-
Context &set(IndexSpaceRegistry ISR)¶
sets the IndexSpaceRegistry for this context
- Parameters:
ISR – an IndexSpaceRegistry
- Returns:
ref to ‘*this’ for chaining
-
Context &set(IndexSpaceMetric metric)¶
Sets the IndexSpaceMetric for this context, convenient for chaining
- Parameters:
metric – IndexSpaceMetric
- Returns:
ref to
*this
, for chaining
-
Context &set(BraKetSymmetry braket_symmetry)¶
Sets the BraKetSymmetry for this context, convenient for chaining
- Parameters:
braket_symmetry – BraKetSymmetry
- Returns:
ref to
*this
, for chaining
-
struct Defaults¶
Public Static Attributes
-
static constexpr auto metric = IndexSpaceMetric::Unit¶
-
static constexpr auto braket_symmetry = BraKetSymmetry::conjugate¶
-
static constexpr auto spbasis = sequant::SPBasis::spinorbital¶
-
static constexpr auto first_dummy_index_ordinal = 100¶
-
static constexpr auto metric = IndexSpaceMetric::Unit¶