A standalone RF calculation package for precomputed energy expectation values. It calculates the normalized standard deviation, RF, and their error bars using Python 3.9+ and NumPy.
- Source code, function reference, and detailed instructions
- Download the package ZIP
- Numerical verification record
From the repository root, run:
python -m pip install ./rf_calculationsfrom rfcalc import rf_from_npy
result = rf_from_npy(
"energies.npy",
num_parameters=10,
normalization=8.0,
n_groups=20,
)
print(result.rf, result.rf_error)Set the parameter count and normalization denominator according to your circuit, Hamiltonian, and calculation convention. Group counts such as 5, 10, and 20 are supported. The sample count must be divisible by the group count, with at least two samples per group.
cd rf_calculations
python example.py
python -m unittest discover -s tests -vThe package includes statistics, normalization, parameter counting, and numeric file loading for existing energy samples. It excludes training, plotting, and complete circuit-sampling workflows. The calculation routines were extracted from the relevant density_state notebooks; see the detailed instructions for their sources and conventions.