Skip to main content

PathIntegralMonteCarlo

Struct PathIntegralMonteCarlo 

Source
pub struct PathIntegralMonteCarlo {
    pub n_slices: usize,
    pub tau: f64,
    pub mass: f64,
    pub path: Vec<f64>,
}
Expand description

A simple Path Integral Monte Carlo estimator for 1D quantum mechanics.

Uses a discrete Euclidean path (imaginary time) to estimate the ground state energy via the virial estimator.

Fields§

§n_slices: usize

Number of time slices.

§tau: f64

Imaginary time step τ = β/N.

§mass: f64

Particle mass.

§path: Vec<f64>

Current path (positions at each time slice).

Implementations§

Source§

impl PathIntegralMonteCarlo

Source

pub fn new(n_slices: usize, beta: f64, mass: f64) -> Self

Create a new PIMC estimator with all positions set to zero.

Source

pub fn kinetic_action(&self) -> f64

Euclidean (kinetic) action for the current path. S_E = Σ_k m/(2τ) * (x_{k+1} − x_k)²

Source

pub fn potential_action_harmonic(&self, omega: f64) -> f64

Harmonic potential action contribution. S_V = τ * Σ_k ½ ω² x_k²

Source

pub fn total_action_harmonic(&self, omega: f64) -> f64

Total Euclidean action (kinetic + harmonic potential).

Source

pub fn virial_energy_estimate(&self, omega: f64) -> f64

Estimate the ground state energy via the virial theorem (harmonic case). E_0 ≈ ½ω² ⟨x²⟩ + ½/(2m τ²) corrections (simplified).

Source

pub fn set_path(&mut self, path: Vec<f64>)

Set the path to a given configuration.

Source

pub fn winding_number(&self) -> f64

Compute the winding number (only meaningful for a ring).

Trait Implementations§

Source§

impl Clone for PathIntegralMonteCarlo

Source§

fn clone(&self) -> PathIntegralMonteCarlo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PathIntegralMonteCarlo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.