Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
localization_policy.hpp
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* LocalizationPolicy — how the gauge inside the chosen subspace is fixed; the
5
* manifest's `localization: none | auto | maximal`, in that order.
6
*
7
* The spread is defined through the neighbour overlaps M_mn(k,b), and a
8
* record imported from another code's projections and eigenvalues alone
9
* carries none. `Preferred` localises when the record can support it and
10
* keeps the projection gauge when it cannot; `Required` makes that an error.
11
* The manifest's default is `auto`, a preference, because defaulting to a
12
* demand would make every such record an error for asking for the default.
13
*/
14
15
#include <stdexcept>
16
#include <string>
17
18
namespace
q3
{
19
20
enum class
LocalizationPolicy
{
None
,
Preferred
,
Required
};
21
22
/// The policy a manifest's `localization` word names; any other word is refused.
23
[[nodiscard]]
inline
LocalizationPolicy
localization_policy_from
(
const
std::string& word) {
24
if
(word ==
"none"
) {
25
return
LocalizationPolicy::None
;
26
}
27
if
(word ==
"auto"
) {
28
return
LocalizationPolicy::Preferred
;
29
}
30
if
(word ==
"maximal"
) {
31
return
LocalizationPolicy::Required
;
32
}
33
throw
std::invalid_argument(
"localization_policy_from: unknown localization '"
+ word +
34
"'. Supported: none, auto, maximal"
);
35
}
36
37
}
// namespace q3
q3
Definition
q3_core_api.hpp:33
q3::localization_policy_from
LocalizationPolicy localization_policy_from(const std::string &word)
The policy a manifest's localization word names; any other word is refused.
Definition
localization_policy.hpp:23
q3::MatrixOperation::None
@ None
q3::LocalizationPolicy
LocalizationPolicy
Definition
localization_policy.hpp:20
q3::LocalizationPolicy::None
@ None
q3::LocalizationPolicy::Preferred
@ Preferred
q3::LocalizationPolicy::Required
@ Required
src
layer_4_computation
interpolator
method
wannier
settings
localization_policy.hpp
Generated by
1.9.8