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
18namespace q3 {
19
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") {
26 }
27 if (word == "auto") {
29 }
30 if (word == "maximal") {
32 }
33 throw std::invalid_argument("localization_policy_from: unknown localization '" + word +
34 "'. Supported: none, auto, maximal");
35}
36
37} // namespace q3
LocalizationPolicy localization_policy_from(const std::string &word)
The policy a manifest's localization word names; any other word is refused.