Loading...
Searching...
No Matches
quantum_state.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * QuantumState — generic quantum state.
5 *
6 * A single quantum state consisting of a wavefunction,
7 * its energy eigenvalue, and its occupation number.
8 * Templated on the wavefunction type, which is
9 * representation-specific (defined in layer 3).
10 */
11
13
14namespace q3 {
15
16/**
17 * A single quantum state: wavefunction + eigenvalue + occupation.
18 */
19template <typename WavefunctionType> struct QuantumState {
20 /// The wavefunction (representation-specific).
21 WavefunctionType wavefunction;
22
23 /// Energy eigenvalue in Rydberg.
25
26 /// Occupation number (0.0 to 1.0 per spin channel).
28
29 /// Whether this state is occupied.
30 [[nodiscard]] bool is_occupied() const {
31 return occupation > 0.0;
32 }
33};
34
35} // namespace q3
double Real
Real occupation
Occupation number (0.0 to 1.0 per spin channel).
bool is_occupied() const
Whether this state is occupied.
Real eigenvalue
Energy eigenvalue in Rydberg.
WavefunctionType wavefunction
The wavefunction (representation-specific).