use crate::device::WgpuDevice;
use std::sync::Arc;
pub const WGSL_BCS_BISECTION: &str =
include_str!("../../shaders/science/hfb/bcs_bisection_f64.wgsl");
pub const WGSL_HFB_DENSITY: &str =
include_str!("../../shaders/science/hfb/batched_hfb_density_f64.wgsl");
pub const WGSL_HFB_ENERGY: &str =
include_str!("../../shaders/science/hfb/batched_hfb_energy_f64.wgsl");
pub const WGSL_HFB_HAMILTONIAN: &str =
include_str!("../../shaders/science/hfb/batched_hfb_hamiltonian_f64.wgsl");
pub const WGSL_HFB_POTENTIALS: &str =
include_str!("../../shaders/science/hfb/batched_hfb_potentials_f64.wgsl");
pub const WGSL_SPIN_ORBIT_PACK: &str =
include_str!("../../shaders/physics/spin_orbit_pack_f64.wgsl");
pub struct HfbPipeline {
device: Arc<WgpuDevice>,
}
impl HfbPipeline {
#[must_use]
pub fn new(device: Arc<WgpuDevice>) -> Self {
Self { device }
}
#[must_use]
pub fn device(&self) -> &Arc<WgpuDevice> {
&self.device
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn bcs_bisection_non_empty_and_has_entry() {
assert!(!WGSL_BCS_BISECTION.is_empty());
assert!(WGSL_BCS_BISECTION.contains("fn bisect"));
}
#[test]
fn hfb_density_non_empty_and_has_entries() {
assert!(!WGSL_HFB_DENSITY.is_empty());
assert!(WGSL_HFB_DENSITY.contains("fn bcs_occupations"));
assert!(WGSL_HFB_DENSITY.contains("fn compute_density"));
assert!(WGSL_HFB_DENSITY.contains("fn mix_density"));
}
#[test]
fn hfb_energy_non_empty_and_has_entries() {
assert!(!WGSL_HFB_ENERGY.is_empty());
assert!(WGSL_HFB_ENERGY.contains("fn energy_integrands"));
assert!(WGSL_HFB_ENERGY.contains("fn reduce_energy"));
}
#[test]
fn hfb_hamiltonian_non_empty_and_has_entry() {
assert!(!WGSL_HFB_HAMILTONIAN.is_empty());
assert!(WGSL_HFB_HAMILTONIAN.contains("fn build_hamiltonian"));
}
#[test]
fn hfb_potentials_non_empty_and_has_entry() {
assert!(!WGSL_HFB_POTENTIALS.is_empty());
assert!(WGSL_HFB_POTENTIALS.contains("fn compute_potentials"));
}
}