Quantum 3xplorer (Q3)
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
12
#include "
layer_0_core/types/init.hpp
"
13
14
namespace
q3
{
15
16
/**
17
* A single quantum state: wavefunction + eigenvalue + occupation.
18
*/
19
template
<
typename
WavefunctionType>
struct
QuantumState
{
20
/// The wavefunction (representation-specific).
21
WavefunctionType
wavefunction
;
22
23
/// Energy eigenvalue in Rydberg.
24
Real
eigenvalue
= 0.0;
25
26
/// Occupation number (0.0 to 1.0 per spin channel).
27
Real
occupation
= 0.0;
28
29
/// Whether this state is occupied.
30
[[nodiscard]]
bool
is_occupied
()
const
{
31
return
occupation
> 0.0;
32
}
33
};
34
35
}
// namespace q3
init.hpp
q3
Definition
q3_core_api.hpp:33
q3::Real
double Real
Definition
type_aliases.hpp:20
q3::QuantumState
Definition
quantum_state.hpp:19
q3::QuantumState::occupation
Real occupation
Occupation number (0.0 to 1.0 per spin channel).
Definition
quantum_state.hpp:27
q3::QuantumState::is_occupied
bool is_occupied() const
Whether this state is occupied.
Definition
quantum_state.hpp:30
q3::QuantumState::eigenvalue
Real eigenvalue
Energy eigenvalue in Rydberg.
Definition
quantum_state.hpp:24
q3::QuantumState::wavefunction
WavefunctionType wavefunction
The wavefunction (representation-specific).
Definition
quantum_state.hpp:21
src
layer_2_quantum_system
core
quantum_state.hpp
Generated by
1.9.8