From e64746056ffd52aa3521c328bf7e684f64103185 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 12 Dec 2023 10:04:22 +0000 Subject: [PATCH] build based on ad78949 --- dev/.documenter-siteinfo.json | 2 +- dev/API/index.html | 2 +- dev/index-ee01065b.svg | 99 +++++++++++++++++++++++++++++++++++ dev/index.html | 8 +-- dev/resources/index.html | 2 + dev/search_index.js | 2 +- dev/theory/index.html | 13 +++++ 7 files changed, 121 insertions(+), 7 deletions(-) create mode 100644 dev/index-ee01065b.svg create mode 100644 dev/resources/index.html create mode 100644 dev/theory/index.html diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 8e32910..e0fddea 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-12T08:38:29","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-12T10:04:18","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/API/index.html b/dev/API/index.html index 17ffac3..2bc4af8 100644 --- a/dev/API/index.html +++ b/dev/API/index.html @@ -1,2 +1,2 @@ -API · FewBodyPhysics.jl

API

Coordinates

FewBodyPhysics.ΩFunction
Ω(masses::Array)

Calculate the Jacobi transformation matrix J and its inverse U for a system of particles with specified masses.

Arguments

  • masses::Array: A vector of masses for the particles.

Returns

  • J::Matrix: The Jacobi transformation matrix.
  • U::Matrix: The inverse of the Jacobi transformation matrix.

Notes

  • For systems with more than one particle, the returned matrices exclude the last row/column for proper dimensionality in transformations.
source
FewBodyPhysics.A_generateFunction
A_generate(bij::Array, w_list::Array)

Generate a matrix A for Gaussian basis functions given width parameters bij and weight vectors w_list.

Arguments

  • bij::Array: A vector of width parameters for the Gaussian basis functions.
  • w_list::Array: A list of weight vectors.

Returns

  • Matrix: The sum of weighted outer products of w_list, scaled by bij.

Notes

  • This function is used to construct basis elements for the expansion of few-body wavefunctions.
source
FewBodyPhysics.transform_listFunction
transform_list(α::Array)

Transform a list of scalar values α into a list of 1x1 matrices.

Arguments

  • α::Array: A list of scalar values.

Returns

  • Array: A list of 1x1 matrices where each matrix contains one of the scalar values from α.
source
FewBodyPhysics.shiftFunction
shift(a::Array, b::Array, mat::Matrix=I)

Calculate the weighted sum of the element-wise product of vectors a and b using matrix mat.

Arguments

  • a::Array: A vector or matrix.
  • b::Array: A vector or matrix of the same size as a.
  • mat::Matrix: An optional matrix to weight the product (default is the identity matrix).

Returns

  • Float64: The weighted sum of products.

Notes

  • a and b are typically shift vectors in the configuration space of a few-body system.
  • If mat is provided, its dimensions must match the number of elements in a and b.
source
FewBodyPhysics.w_genFunction
w_gen(dim::Int, i::Int, j::Int)

Generate a weight vector for the i-th and j-th coordinates in a space of dimension dim.

Arguments

  • dim::Int: The dimension of the space.
  • i::Int: The index for the positive element in the weight vector.
  • j::Int: The index for the negative element in the weight vector.

Returns

  • Vector{Int}: A vector with 1 at the i-th position, -1 at the j-th position, and 0 elsewhere.

Notes

  • This function is useful for generating basis vectors in few-body coordinate transformations.
source
FewBodyPhysics.transform_coordinatesFunction
transform_coordinates(Ω::Matrix{Float64}, r::Vector{Float64})

Transform the coordinates r of a system using the Jacobi matrix Ω.

Arguments

  • Ω::Matrix{Float64}: The Jacobi transformation matrix.
  • r::Vector{Float64}: The coordinates to be transformed.

Returns

  • Vector{Float64}: The transformed coordinates.

Notes

  • This function applies the inverse of Jacobi matrix J to the coordinate vector r.
source
FewBodyPhysics.transform_backFunction
transform_back(Ω::Matrix{Float64}, x::Matrix{Float64})

Transform the coordinates x back to the original system using the inverse of the Jacobi matrix Ω.

Arguments

  • Ω::Matrix{Float64}: The Jacobi transformation matrix.
  • x::Matrix{Float64}: The coordinates to be transformed back.

Returns

  • Matrix{Float64}: The coordinates transformed back to the original system.

Notes

  • This function applies the inverse of matrix U to the coordinate matrix x.
source

Matrix elements

FewBodyPhysics.S_elementsFunction
S_elements(A, B, K, w=nothing)

Calculate matrix elements for overlap, kinetic energy, and optionally the Coulomb term.

Arguments

  • A::Matrix: Matrix representing the width of Gaussian basis functions for state i.
  • B::Matrix: Matrix representing the width of Gaussian basis functions for state j.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • M0::Float64: The overlap matrix element between the two states.
  • tra::Float64: The trace used in the kinetic energy calculation.
  • Coulomb_term::Float64 (optional): The Coulomb interaction term, if weight vectors w are provided.

Notes

  • The Coulomb term is calculated only if the weight vectors w are specified.
source
FewBodyPhysics.S_waveFunction
S_wave(α, K, w=nothing)

Calculate the wavefunction overlap, kinetic energy, and optionally Coulomb interaction matrices for a given set of basis functions.

Arguments

  • α::Vector: A list of scalar width parameters for the Gaussian basis functions.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • overlap::Matrix: The overlap matrix for the basis functions.
  • kinetic::Matrix: The kinetic energy matrix for the basis functions.
  • Coulomb::Matrix (optional): The Coulomb interaction matrix, if weight vectors w are specified.

Notes

  • The Coulomb matrix is computed only if the weight vectors w are specified.
source
FewBodyPhysics.S_energyFunction
S_energy(bij, K, w)

Compute the ground state energy of the system using the basis functions specified by the width parameters bij.

Arguments

  • bij::Vector: A list of width parameters for the Gaussian basis functions.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector: Weight vectors for the particles involved.

Returns

  • E0::Float64: The lowest eigenvalue computed from the Hamiltonian, considered as the ground state energy of the system.

Notes

  • This function constructs the Hamiltonian from the overlap, kinetic, and Coulomb matrices and solves for its eigenvalues.
source
FewBodyPhysics.P_elementsFunction
P_elements(a, b, A, B, K, w=nothing)

Calculate the perturbation matrix elements given two basis states represented by vectors a and b, and their respective width matrices A and B.

Arguments

  • a::Vector: The coefficient vector for basis state i.
  • b::Vector: The coefficient vector for basis state j.
  • A::Matrix: Matrix representing the width of Gaussian basis functions for state i.
  • B::Matrix: Matrix representing the width of Gaussian basis functions for state j.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • M1::Float64: The overlap perturbation term.
  • kinetic::Float64: The kinetic energy perturbation term.
  • Coulomb_term::Float64 (optional): The Coulomb interaction perturbation term, if weight vectors w are provided.

Notes

  • The Coulomb interaction perturbation term is calculated only if the weight vectors w are specified.
source
FewBodyPhysics.pion_nucleonFunction
pion_nucleon(alphas, masses, params)

Calculate the overlap and kinetic matrices for a pion-nucleon system.

Arguments

  • alphas: A vector of alpha values, which are parameters related to the Gaussian basis functions.
  • masses: A 2-element vector containing the masses of the nucleon and the pion, respectively.
  • params: A 2-element vector containing the parameters b and S.

Returns

  • overlap: A matrix representing the overlap between the basis functions.
  • kinetic: A matrix representing the kinetic energy elements.

Description

The function calculates the overlap and kinetic matrices for a pion-nucleon system using Gaussian basis functions. The overlap matrix elements are calculated as integrals of the product of two basis functions, and the kinetic matrix elements are calculated as integrals of the product of the derivatives of two basis functions.

The function uses the reduced mass of the pion-nucleon system, the parameter b related to the width of the Gaussian functions, and the parameter S related to the amplitude of the Gaussian functions.

The matrices are symmetric, and the diagonal elements of the overlap matrix are 1. The off-diagonal elements are calculated using the alpha parameters and the b and S parameters.

source
FewBodyPhysics.ComputeEigenSystemFunction
ComputeEigenSystem(bs, masses, params)

Calculate the eigenvalues and eigenvectors of a system defined by parameters bs, masses, and params.

Arguments

  • bs: Array of parameter values used in the computation.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters required for the calculation.

Returns

  • Tuple of eigenvalues (E) and eigenvectors (c).
source
FewBodyPhysics.GetMinimumEnergyFunction
GetMinimumEnergy(bs, masses, params)

Compute the minimum energy of a system characterized by bs, masses, and params.

Arguments

  • bs: Array of parameter values used in the computation.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters required for the calculation.

Returns

  • Minimum energy value of the system.
source
FewBodyPhysics.OptimizeGlobalParametersFunction
OptimizeGlobalParameters(ngauss, dim, bmax, masses, params)

Perform global optimization over a given parameter space to find optimal parameters for a physical system.

Arguments

  • ngauss: Number of Gaussian functions used in the optimization.
  • dim: Dimensionality of the parameter space.
  • bmax: Maximum value of the parameter b.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters used in the optimization.

Returns

  • E_list: List of optimized energies.
  • gaussians: List of Gaussian functions used.
  • coords: Optimized coordinates in the parameter space.
  • eigenvectors: Eigenvectors corresponding to the optimized coordinates.
  • masses: Updated masses array.
source

Sampling

FewBodyPhysics.corputFunction

Generate the nth element of the van der Corput sequence in base b.

Arguments

  • n: The nth element of the sequence to be generated.
  • b: The base for the van der Corput sequence. Default is 3.

Returns

  • q: The nth element of the van der Corput sequence in base b.
source
FewBodyPhysics.haltonFunction

Generate the nth d-dimensional point in the Halton sequence.

Arguments

  • n: The nth element of the sequence to be generated.
  • d: The dimension of the space.

Returns

  • An array containing the nth d-dimensional point in the Halton sequence.

Errors

  • Throws an assertion error if d exceeds the number of basis elements.
source
FewBodyPhysics.run_simulationFunction

Run the simulation for a quantum system using quasi-random or pseudo-random methods to determine the S-wave convergence.

Arguments

  • num_gauss::Int: The number of Gaussians to use in the simulation. Default is 15.
  • method::Symbol: The method to use for the simulation. Can be :quasirandom, :quasirandomrefined, or :psudorandom. Default is :quasirandom.
  • plot_result::Bool: Whether to plot the results. Default is true.

Returns

  • p: The plot object if plot_result is true.

Notes

  • The function prints various convergence information and, if plot_result is true, displays a plot of the numerical result against the theoretical value.
source
FewBodyPhysics.run_simulation_nuclearFunction
run_simulation_nuclear(ngauss=2, dim=2, bmax=5)

Run a nuclear simulation and print the final energy.

Arguments

  • ngauss: Number of Gaussian functions to use in the simulation (default is 2).
  • dim: Dimension of the simulation (default is 2).
  • bmax: Maximum impact parameter (default is 5).

Outputs

Prints the final energy of the simulation.

Example

```julia runsimulationnuclear(3, 3, 10)

source
+API · FewBodyPhysics.jl

API

Coordinates

FewBodyPhysics.ΩFunction
Ω(masses::Array)

Calculate the Jacobi transformation matrix J and its inverse U for a system of particles with specified masses.

Arguments

  • masses::Array: A vector of masses for the particles.

Returns

  • J::Matrix: The Jacobi transformation matrix.
  • U::Matrix: The inverse of the Jacobi transformation matrix.

Notes

  • For systems with more than one particle, the returned matrices exclude the last row/column for proper dimensionality in transformations.
source
FewBodyPhysics.A_generateFunction
A_generate(bij::Array, w_list::Array)

Generate a matrix A for Gaussian basis functions given width parameters bij and weight vectors w_list.

Arguments

  • bij::Array: A vector of width parameters for the Gaussian basis functions.
  • w_list::Array: A list of weight vectors.

Returns

  • Matrix: The sum of weighted outer products of w_list, scaled by bij.

Notes

  • This function is used to construct basis elements for the expansion of few-body wavefunctions.
source
FewBodyPhysics.transform_listFunction
transform_list(α::Array)

Transform a list of scalar values α into a list of 1x1 matrices.

Arguments

  • α::Array: A list of scalar values.

Returns

  • Array: A list of 1x1 matrices where each matrix contains one of the scalar values from α.
source
FewBodyPhysics.shiftFunction
shift(a::Array, b::Array, mat::Matrix=I)

Calculate the weighted sum of the element-wise product of vectors a and b using matrix mat.

Arguments

  • a::Array: A vector or matrix.
  • b::Array: A vector or matrix of the same size as a.
  • mat::Matrix: An optional matrix to weight the product (default is the identity matrix).

Returns

  • Float64: The weighted sum of products.

Notes

  • a and b are typically shift vectors in the configuration space of a few-body system.
  • If mat is provided, its dimensions must match the number of elements in a and b.
source
FewBodyPhysics.w_genFunction
w_gen(dim::Int, i::Int, j::Int)

Generate a weight vector for the i-th and j-th coordinates in a space of dimension dim.

Arguments

  • dim::Int: The dimension of the space.
  • i::Int: The index for the positive element in the weight vector.
  • j::Int: The index for the negative element in the weight vector.

Returns

  • Vector{Int}: A vector with 1 at the i-th position, -1 at the j-th position, and 0 elsewhere.

Notes

  • This function is useful for generating basis vectors in few-body coordinate transformations.
source
FewBodyPhysics.transform_coordinatesFunction
transform_coordinates(Ω::Matrix{Float64}, r::Vector{Float64})

Transform the coordinates r of a system using the Jacobi matrix Ω.

Arguments

  • Ω::Matrix{Float64}: The Jacobi transformation matrix.
  • r::Vector{Float64}: The coordinates to be transformed.

Returns

  • Vector{Float64}: The transformed coordinates.

Notes

  • This function applies the inverse of Jacobi matrix J to the coordinate vector r.
source
FewBodyPhysics.transform_backFunction
transform_back(Ω::Matrix{Float64}, x::Matrix{Float64})

Transform the coordinates x back to the original system using the inverse of the Jacobi matrix Ω.

Arguments

  • Ω::Matrix{Float64}: The Jacobi transformation matrix.
  • x::Matrix{Float64}: The coordinates to be transformed back.

Returns

  • Matrix{Float64}: The coordinates transformed back to the original system.

Notes

  • This function applies the inverse of matrix U to the coordinate matrix x.
source

Matrix elements

FewBodyPhysics.S_elementsFunction
S_elements(A, B, K, w=nothing)

Calculate matrix elements for overlap, kinetic energy, and optionally the Coulomb term.

Arguments

  • A::Matrix: Matrix representing the width of Gaussian basis functions for state i.
  • B::Matrix: Matrix representing the width of Gaussian basis functions for state j.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • M0::Float64: The overlap matrix element between the two states.
  • tra::Float64: The trace used in the kinetic energy calculation.
  • Coulomb_term::Float64 (optional): The Coulomb interaction term, if weight vectors w are provided.

Notes

  • The Coulomb term is calculated only if the weight vectors w are specified.
source
FewBodyPhysics.S_waveFunction
S_wave(α, K, w=nothing)

Calculate the wavefunction overlap, kinetic energy, and optionally Coulomb interaction matrices for a given set of basis functions.

Arguments

  • α::Vector: A list of scalar width parameters for the Gaussian basis functions.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • overlap::Matrix: The overlap matrix for the basis functions.
  • kinetic::Matrix: The kinetic energy matrix for the basis functions.
  • Coulomb::Matrix (optional): The Coulomb interaction matrix, if weight vectors w are specified.

Notes

  • The Coulomb matrix is computed only if the weight vectors w are specified.
source
FewBodyPhysics.S_energyFunction
S_energy(bij, K, w)

Compute the ground state energy of the system using the basis functions specified by the width parameters bij.

Arguments

  • bij::Vector: A list of width parameters for the Gaussian basis functions.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector: Weight vectors for the particles involved.

Returns

  • E0::Float64: The lowest eigenvalue computed from the Hamiltonian, considered as the ground state energy of the system.

Notes

  • This function constructs the Hamiltonian from the overlap, kinetic, and Coulomb matrices and solves for its eigenvalues.
source
FewBodyPhysics.P_elementsFunction
P_elements(a, b, A, B, K, w=nothing)

Calculate the perturbation matrix elements given two basis states represented by vectors a and b, and their respective width matrices A and B.

Arguments

  • a::Vector: The coefficient vector for basis state i.
  • b::Vector: The coefficient vector for basis state j.
  • A::Matrix: Matrix representing the width of Gaussian basis functions for state i.
  • B::Matrix: Matrix representing the width of Gaussian basis functions for state j.
  • K::Matrix: Kinetic energy matrix.
  • w::Vector (optional): Weight vectors for the particles involved.

Returns

  • M1::Float64: The overlap perturbation term.
  • kinetic::Float64: The kinetic energy perturbation term.
  • Coulomb_term::Float64 (optional): The Coulomb interaction perturbation term, if weight vectors w are provided.

Notes

  • The Coulomb interaction perturbation term is calculated only if the weight vectors w are specified.
source
FewBodyPhysics.pion_nucleonFunction
pion_nucleon(alphas, masses, params)

Calculate the overlap and kinetic matrices for a pion-nucleon system.

Arguments

  • alphas: A vector of alpha values, which are parameters related to the Gaussian basis functions.
  • masses: A 2-element vector containing the masses of the nucleon and the pion, respectively.
  • params: A 2-element vector containing the parameters b and S.

Returns

  • overlap: A matrix representing the overlap between the basis functions.
  • kinetic: A matrix representing the kinetic energy elements.

Description

The function calculates the overlap and kinetic matrices for a pion-nucleon system using Gaussian basis functions. The overlap matrix elements are calculated as integrals of the product of two basis functions, and the kinetic matrix elements are calculated as integrals of the product of the derivatives of two basis functions.

The function uses the reduced mass of the pion-nucleon system, the parameter b related to the width of the Gaussian functions, and the parameter S related to the amplitude of the Gaussian functions.

The matrices are symmetric, and the diagonal elements of the overlap matrix are 1. The off-diagonal elements are calculated using the alpha parameters and the b and S parameters.

source
FewBodyPhysics.ComputeEigenSystemFunction
ComputeEigenSystem(bs, masses, params)

Calculate the eigenvalues and eigenvectors of a system defined by parameters bs, masses, and params.

Arguments

  • bs: Array of parameter values used in the computation.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters required for the calculation.

Returns

  • Tuple of eigenvalues (E) and eigenvectors (c).
source
FewBodyPhysics.GetMinimumEnergyFunction
GetMinimumEnergy(bs, masses, params)

Compute the minimum energy of a system characterized by bs, masses, and params.

Arguments

  • bs: Array of parameter values used in the computation.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters required for the calculation.

Returns

  • Minimum energy value of the system.
source
FewBodyPhysics.OptimizeGlobalParametersFunction
OptimizeGlobalParameters(ngauss, dim, bmax, masses, params)

Perform global optimization over a given parameter space to find optimal parameters for a physical system.

Arguments

  • ngauss: Number of Gaussian functions used in the optimization.
  • dim: Dimensionality of the parameter space.
  • bmax: Maximum value of the parameter b.
  • masses: Array of masses, representing physical properties of the system.
  • params: Additional parameters used in the optimization.

Returns

  • E_list: List of optimized energies.
  • gaussians: List of Gaussian functions used.
  • coords: Optimized coordinates in the parameter space.
  • eigenvectors: Eigenvectors corresponding to the optimized coordinates.
  • masses: Updated masses array.
source

Sampling

FewBodyPhysics.corputFunction

Generate the nth element of the van der Corput sequence in base b.

Arguments

  • n: The nth element of the sequence to be generated.
  • b: The base for the van der Corput sequence. Default is 3.

Returns

  • q: The nth element of the van der Corput sequence in base b.
source
FewBodyPhysics.haltonFunction

Generate the nth d-dimensional point in the Halton sequence.

Arguments

  • n: The nth element of the sequence to be generated.
  • d: The dimension of the space.

Returns

  • An array containing the nth d-dimensional point in the Halton sequence.

Errors

  • Throws an assertion error if d exceeds the number of basis elements.
source
FewBodyPhysics.run_simulationFunction

Run the simulation for a quantum system using quasi-random or pseudo-random methods to determine the S-wave convergence.

Arguments

  • num_gauss::Int: The number of Gaussians to use in the simulation. Default is 15.
  • method::Symbol: The method to use for the simulation. Can be :quasirandom, :quasirandomrefined, or :psudorandom. Default is :quasirandom.
  • plot_result::Bool: Whether to plot the results. Default is true.

Returns

  • p: The plot object if plot_result is true.

Notes

  • The function prints various convergence information and, if plot_result is true, displays a plot of the numerical result against the theoretical value.
source
FewBodyPhysics.run_simulation_nuclearFunction
run_simulation_nuclear(ngauss=2, dim=2, bmax=5)

Run a nuclear simulation and print the final energy.

Arguments

  • ngauss: Number of Gaussian functions to use in the simulation (default is 2).
  • dim: Dimension of the simulation (default is 2).
  • bmax: Maximum impact parameter (default is 5).

Outputs

Prints the final energy of the simulation.

Example

```julia runsimulationnuclear(3, 3, 10)

source
diff --git a/dev/index-ee01065b.svg b/dev/index-ee01065b.svg new file mode 100644 index 0000000..a1d5d8f --- /dev/null +++ b/dev/index-ee01065b.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/index.html b/dev/index.html index af087ac..e10f950 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,11 +1,11 @@ -FewBodyPhysics.jl · FewBodyPhysics.jl

FewBodyPhysics.jl

Installation

Get the latest stable release with Julia's package manager:

julia ] add FewBodyPhysics

Quick example

using Plots, FewBodyPhysics
+FewBodyPhysics.jl · FewBodyPhysics.jl

FewBodyPhysics.jl

Installation

Get the latest stable release with Julia's package manager:

julia ] add FewBodyPhysics

Quick example

using Plots, FewBodyPhysics
 
 w_list = [ [1, -1, 0], [1, 0, -1], [0, 1, -1] ]
 masses = [1, 1, 1]
 K = [0 0 0; 0 1/2 0; 0 0 1/2]
 J, U = Ω(masses)
-K_trans = J * K * J'
-w_trans = [U' * w_list[i] for i in 1:length(w_list)]
+K_transformed = J * K * J'
+w_transformed = [U' * w_list[i] for i in 1:length(w_list)];
 
-run_simulation(50,:psudorandom)
+p = run_simulation(50, :quasirandom, w_transformed, K_transformed)
Example block output
diff --git a/dev/resources/index.html b/dev/resources/index.html new file mode 100644 index 0000000..d7ca2c6 --- /dev/null +++ b/dev/resources/index.html @@ -0,0 +1,2 @@ + +Resources · FewBodyPhysics.jl

Resources

  • Stochastic Variational Approach to Quantum-Mechanical Few-Body Problems, Yasuyuki Suzuki , Kálmán Varga
  • https://arxiv.org/pdf/2209.12071.pdf
  • https://arxiv.org/pdf/1910.05223.pdf
  • https://arxiv.org/pdf/1910.02705.pdf
  • https://en.wikibooks.org/wiki/CorrelatedGaussianmethodinQuantum_Mechanics
diff --git a/dev/search_index.js b/dev/search_index.js index 6273389..ddb673c 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#FewBodyPhysics.jl","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"","category":"section"},{"location":"#Installation","page":"FewBodyPhysics.jl","title":"Installation","text":"","category":"section"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"Get the latest stable release with Julia's package manager:","category":"page"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"julia ] add FewBodyPhysics","category":"page"},{"location":"#Quick-example","page":"FewBodyPhysics.jl","title":"Quick example","text":"","category":"section"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"using Plots, FewBodyPhysics\n\nw_list = [ [1, -1, 0], [1, 0, -1], [0, 1, -1] ]\nmasses = [1, 1, 1]\nK = [0 0 0; 0 1/2 0; 0 0 1/2]\nJ, U = Ω(masses)\nK_trans = J * K * J'\nw_trans = [U' * w_list[i] for i in 1:length(w_list)]\n\nrun_simulation(50,:psudorandom)","category":"page"},{"location":"API/#API","page":"API","title":"API","text":"","category":"section"},{"location":"API/#Coordinates","page":"API","title":"Coordinates","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"Ω\nA_generate\ntransform_list\nshift\nw_gen\ntransform_coordinates\ntransform_back","category":"page"},{"location":"API/#FewBodyPhysics.Ω","page":"API","title":"FewBodyPhysics.Ω","text":"Ω(masses::Array)\n\nCalculate the Jacobi transformation matrix J and its inverse U for a system of particles with specified masses.\n\nArguments\n\nmasses::Array: A vector of masses for the particles.\n\nReturns\n\nJ::Matrix: The Jacobi transformation matrix.\nU::Matrix: The inverse of the Jacobi transformation matrix.\n\nNotes\n\nFor systems with more than one particle, the returned matrices exclude the last row/column for proper dimensionality in transformations.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.A_generate","page":"API","title":"FewBodyPhysics.A_generate","text":"A_generate(bij::Array, w_list::Array)\n\nGenerate a matrix A for Gaussian basis functions given width parameters bij and weight vectors w_list.\n\nArguments\n\nbij::Array: A vector of width parameters for the Gaussian basis functions.\nw_list::Array: A list of weight vectors.\n\nReturns\n\nMatrix: The sum of weighted outer products of w_list, scaled by bij.\n\nNotes\n\nThis function is used to construct basis elements for the expansion of few-body wavefunctions.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_list","page":"API","title":"FewBodyPhysics.transform_list","text":"transform_list(α::Array)\n\nTransform a list of scalar values α into a list of 1x1 matrices.\n\nArguments\n\nα::Array: A list of scalar values.\n\nReturns\n\nArray: A list of 1x1 matrices where each matrix contains one of the scalar values from α.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.shift","page":"API","title":"FewBodyPhysics.shift","text":"shift(a::Array, b::Array, mat::Matrix=I)\n\nCalculate the weighted sum of the element-wise product of vectors a and b using matrix mat.\n\nArguments\n\na::Array: A vector or matrix.\nb::Array: A vector or matrix of the same size as a.\nmat::Matrix: An optional matrix to weight the product (default is the identity matrix).\n\nReturns\n\nFloat64: The weighted sum of products.\n\nNotes\n\na and b are typically shift vectors in the configuration space of a few-body system.\nIf mat is provided, its dimensions must match the number of elements in a and b.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.w_gen","page":"API","title":"FewBodyPhysics.w_gen","text":"w_gen(dim::Int, i::Int, j::Int)\n\nGenerate a weight vector for the i-th and j-th coordinates in a space of dimension dim.\n\nArguments\n\ndim::Int: The dimension of the space.\ni::Int: The index for the positive element in the weight vector.\nj::Int: The index for the negative element in the weight vector.\n\nReturns\n\nVector{Int}: A vector with 1 at the i-th position, -1 at the j-th position, and 0 elsewhere.\n\nNotes\n\nThis function is useful for generating basis vectors in few-body coordinate transformations.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_coordinates","page":"API","title":"FewBodyPhysics.transform_coordinates","text":"transform_coordinates(Ω::Matrix{Float64}, r::Vector{Float64})\n\nTransform the coordinates r of a system using the Jacobi matrix Ω.\n\nArguments\n\nΩ::Matrix{Float64}: The Jacobi transformation matrix.\nr::Vector{Float64}: The coordinates to be transformed.\n\nReturns\n\nVector{Float64}: The transformed coordinates.\n\nNotes\n\nThis function applies the inverse of Jacobi matrix J to the coordinate vector r.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_back","page":"API","title":"FewBodyPhysics.transform_back","text":"transform_back(Ω::Matrix{Float64}, x::Matrix{Float64})\n\nTransform the coordinates x back to the original system using the inverse of the Jacobi matrix Ω.\n\nArguments\n\nΩ::Matrix{Float64}: The Jacobi transformation matrix.\nx::Matrix{Float64}: The coordinates to be transformed back.\n\nReturns\n\nMatrix{Float64}: The coordinates transformed back to the original system.\n\nNotes\n\nThis function applies the inverse of matrix U to the coordinate matrix x.\n\n\n\n\n\n","category":"function"},{"location":"API/#Matrix-elements","page":"API","title":"Matrix elements","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"S_elements\nS_wave\nS_energy\nP_elements\npion_nucleon\nComputeEigenSystem\nGetMinimumEnergy\nOptimizeGlobalParameters","category":"page"},{"location":"API/#FewBodyPhysics.S_elements","page":"API","title":"FewBodyPhysics.S_elements","text":"S_elements(A, B, K, w=nothing)\n\nCalculate matrix elements for overlap, kinetic energy, and optionally the Coulomb term.\n\nArguments\n\nA::Matrix: Matrix representing the width of Gaussian basis functions for state i.\nB::Matrix: Matrix representing the width of Gaussian basis functions for state j.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\nM0::Float64: The overlap matrix element between the two states.\ntra::Float64: The trace used in the kinetic energy calculation.\nCoulomb_term::Float64 (optional): The Coulomb interaction term, if weight vectors w are provided.\n\nNotes\n\nThe Coulomb term is calculated only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.S_wave","page":"API","title":"FewBodyPhysics.S_wave","text":"S_wave(α, K, w=nothing)\n\nCalculate the wavefunction overlap, kinetic energy, and optionally Coulomb interaction matrices for a given set of basis functions.\n\nArguments\n\nα::Vector: A list of scalar width parameters for the Gaussian basis functions.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\noverlap::Matrix: The overlap matrix for the basis functions.\nkinetic::Matrix: The kinetic energy matrix for the basis functions.\nCoulomb::Matrix (optional): The Coulomb interaction matrix, if weight vectors w are specified.\n\nNotes\n\nThe Coulomb matrix is computed only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.S_energy","page":"API","title":"FewBodyPhysics.S_energy","text":"S_energy(bij, K, w)\n\nCompute the ground state energy of the system using the basis functions specified by the width parameters bij.\n\nArguments\n\nbij::Vector: A list of width parameters for the Gaussian basis functions.\nK::Matrix: Kinetic energy matrix.\nw::Vector: Weight vectors for the particles involved.\n\nReturns\n\nE0::Float64: The lowest eigenvalue computed from the Hamiltonian, considered as the ground state energy of the system.\n\nNotes\n\nThis function constructs the Hamiltonian from the overlap, kinetic, and Coulomb matrices and solves for its eigenvalues.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.P_elements","page":"API","title":"FewBodyPhysics.P_elements","text":"P_elements(a, b, A, B, K, w=nothing)\n\nCalculate the perturbation matrix elements given two basis states represented by vectors a and b, and their respective width matrices A and B.\n\nArguments\n\na::Vector: The coefficient vector for basis state i.\nb::Vector: The coefficient vector for basis state j.\nA::Matrix: Matrix representing the width of Gaussian basis functions for state i.\nB::Matrix: Matrix representing the width of Gaussian basis functions for state j.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\nM1::Float64: The overlap perturbation term.\nkinetic::Float64: The kinetic energy perturbation term.\nCoulomb_term::Float64 (optional): The Coulomb interaction perturbation term, if weight vectors w are provided.\n\nNotes\n\nThe Coulomb interaction perturbation term is calculated only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.pion_nucleon","page":"API","title":"FewBodyPhysics.pion_nucleon","text":"pion_nucleon(alphas, masses, params)\n\nCalculate the overlap and kinetic matrices for a pion-nucleon system.\n\nArguments\n\nalphas: A vector of alpha values, which are parameters related to the Gaussian basis functions.\nmasses: A 2-element vector containing the masses of the nucleon and the pion, respectively.\nparams: A 2-element vector containing the parameters b and S.\n\nReturns\n\noverlap: A matrix representing the overlap between the basis functions.\nkinetic: A matrix representing the kinetic energy elements.\n\nDescription\n\nThe function calculates the overlap and kinetic matrices for a pion-nucleon system using Gaussian basis functions. The overlap matrix elements are calculated as integrals of the product of two basis functions, and the kinetic matrix elements are calculated as integrals of the product of the derivatives of two basis functions.\n\nThe function uses the reduced mass of the pion-nucleon system, the parameter b related to the width of the Gaussian functions, and the parameter S related to the amplitude of the Gaussian functions.\n\nThe matrices are symmetric, and the diagonal elements of the overlap matrix are 1. The off-diagonal elements are calculated using the alpha parameters and the b and S parameters.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.ComputeEigenSystem","page":"API","title":"FewBodyPhysics.ComputeEigenSystem","text":"ComputeEigenSystem(bs, masses, params)\n\nCalculate the eigenvalues and eigenvectors of a system defined by parameters bs, masses, and params.\n\nArguments\n\nbs: Array of parameter values used in the computation.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters required for the calculation.\n\nReturns\n\nTuple of eigenvalues (E) and eigenvectors (c).\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.GetMinimumEnergy","page":"API","title":"FewBodyPhysics.GetMinimumEnergy","text":"GetMinimumEnergy(bs, masses, params)\n\nCompute the minimum energy of a system characterized by bs, masses, and params.\n\nArguments\n\nbs: Array of parameter values used in the computation.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters required for the calculation.\n\nReturns\n\nMinimum energy value of the system.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.OptimizeGlobalParameters","page":"API","title":"FewBodyPhysics.OptimizeGlobalParameters","text":"OptimizeGlobalParameters(ngauss, dim, bmax, masses, params)\n\nPerform global optimization over a given parameter space to find optimal parameters for a physical system.\n\nArguments\n\nngauss: Number of Gaussian functions used in the optimization.\ndim: Dimensionality of the parameter space.\nbmax: Maximum value of the parameter b.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters used in the optimization.\n\nReturns\n\nE_list: List of optimized energies.\ngaussians: List of Gaussian functions used.\ncoords: Optimized coordinates in the parameter space.\neigenvectors: Eigenvectors corresponding to the optimized coordinates.\nmasses: Updated masses array.\n\n\n\n\n\n","category":"function"},{"location":"API/#Sampling","page":"API","title":"Sampling","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"corput\nhalton\nrun_simulation\nrun_simulation_nuclear","category":"page"},{"location":"API/#FewBodyPhysics.corput","page":"API","title":"FewBodyPhysics.corput","text":"Generate the nth element of the van der Corput sequence in base b.\n\nArguments\n\nn: The nth element of the sequence to be generated.\nb: The base for the van der Corput sequence. Default is 3.\n\nReturns\n\nq: The nth element of the van der Corput sequence in base b.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.halton","page":"API","title":"FewBodyPhysics.halton","text":"Generate the nth d-dimensional point in the Halton sequence.\n\nArguments\n\nn: The nth element of the sequence to be generated.\nd: The dimension of the space.\n\nReturns\n\nAn array containing the nth d-dimensional point in the Halton sequence.\n\nErrors\n\nThrows an assertion error if d exceeds the number of basis elements.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.run_simulation","page":"API","title":"FewBodyPhysics.run_simulation","text":"Run the simulation for a quantum system using quasi-random or pseudo-random methods to determine the S-wave convergence.\n\nArguments\n\nnum_gauss::Int: The number of Gaussians to use in the simulation. Default is 15.\nmethod::Symbol: The method to use for the simulation. Can be :quasirandom, :quasirandomrefined, or :psudorandom. Default is :quasirandom.\nplot_result::Bool: Whether to plot the results. Default is true.\n\nReturns\n\np: The plot object if plot_result is true.\n\nNotes\n\nThe function prints various convergence information and, if plot_result is true, displays a plot of the numerical result against the theoretical value.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.run_simulation_nuclear","page":"API","title":"FewBodyPhysics.run_simulation_nuclear","text":"run_simulation_nuclear(ngauss=2, dim=2, bmax=5)\n\nRun a nuclear simulation and print the final energy.\n\nArguments\n\nngauss: Number of Gaussian functions to use in the simulation (default is 2).\ndim: Dimension of the simulation (default is 2).\nbmax: Maximum impact parameter (default is 5).\n\nOutputs\n\nPrints the final energy of the simulation.\n\nExample\n\n```julia runsimulationnuclear(3, 3, 10)\n\n\n\n\n\n","category":"function"}] +[{"location":"resources/#Resources","page":"Resources","title":"Resources","text":"","category":"section"},{"location":"resources/","page":"Resources","title":"Resources","text":"Stochastic Variational Approach to Quantum-Mechanical Few-Body Problems, Yasuyuki Suzuki , Kálmán Varga\nhttps://arxiv.org/pdf/2209.12071.pdf\nhttps://arxiv.org/pdf/1910.05223.pdf\nhttps://arxiv.org/pdf/1910.02705.pdf\nhttps://en.wikibooks.org/wiki/CorrelatedGaussianmethodinQuantum_Mechanics","category":"page"},{"location":"theory/#Theory","page":"Theory","title":"Theory","text":"","category":"section"},{"location":"theory/#Basis-expansion-of-the-Schrödinger-equation","page":"Theory","title":"Basis expansion of the Schrödinger equation","text":"","category":"section"},{"location":"theory/","page":"Theory","title":"Theory","text":"We are going to solve the Schrödinger equation","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"hatHpsirangle = epsilonpsirangle","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"where hatH is the Hamiltonian of a quantum few-body system, psirangle and epsilon are the eigenfunction and the eigenvalue to be found.","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"We shall expand the wave-function psirangle in terms of a set of basis functions irangle for i = 1 ldots n,","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"psirangle = sum_i=1^n c_i irangle","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"Inserting the expansion into the Schrödinger equation and multiplying from the left with langle k for 1 leq k leq n gives","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"sum_i=1^n langle khatHirangle c_i = epsilon sum_i=1^n langle kirangle c_i","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"Or, in the matrix notation","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"Hc = epsilon Nc","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"where H and N are correspondingly the Hamiltonian and the overlap matrices with the matrix elements","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"H_ki = langle khatHirangle quad N_ki","category":"page"},{"location":"theory/#Gaussians-as-basis-functions","page":"Theory","title":"Gaussians as basis functions","text":"","category":"section"},{"location":"theory/","page":"Theory","title":"Theory","text":"We shall use the so-called Correlated Gaussians (or Explicitly Correlated Gaussians) as the basis functions. For a system of N particles with coordinates vecr_i, i = 1 ldots N, the Correlated Gaussian is defined as","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"g(vecr_1 ldots vecr_N) = exp left( - sum_ij=1^N A_ijvecr_i cdot vecr_j - sum_i=1^N vecs_i cdot vecr_i right)","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"where vecr_i cdot vecr_j denotes the dot-product of the two vectors; and where A, a symmetric positive-defined matrix, and vecs_i, i=1ldotsN, the shift-vectors, are (cleverly chosen) parameters of the Gaussian.","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"In matrix notation,","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"g(vecr) = exp left( -vecr^T A vecr + vecs^T vecr right)","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"where vecr is the column of the coordinates vecr_i and vecs is the column of the shift-vectors vecs_i,","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"vecr =\nbeginpmatrix\nvecr_1 \nvdots \nvecr_N\nendpmatrix quad\nvecs =\nbeginpmatrix\nvecs_1 \nvdots \nvecs_N\nendpmatrix","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"and","category":"page"},{"location":"theory/","page":"Theory","title":"Theory","text":"vecr^T A vecr + vecs^T vecr = sum_ij vecr_i cdot A_ijvecr_j + sum_i vecs_i cdot vecr_i","category":"page"},{"location":"#FewBodyPhysics.jl","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"","category":"section"},{"location":"#Installation","page":"FewBodyPhysics.jl","title":"Installation","text":"","category":"section"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"Get the latest stable release with Julia's package manager:","category":"page"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"julia ] add FewBodyPhysics","category":"page"},{"location":"#Quick-example","page":"FewBodyPhysics.jl","title":"Quick example","text":"","category":"section"},{"location":"","page":"FewBodyPhysics.jl","title":"FewBodyPhysics.jl","text":"using Plots, FewBodyPhysics\n\nw_list = [ [1, -1, 0], [1, 0, -1], [0, 1, -1] ]\nmasses = [1, 1, 1]\nK = [0 0 0; 0 1/2 0; 0 0 1/2]\nJ, U = Ω(masses)\nK_transformed = J * K * J'\nw_transformed = [U' * w_list[i] for i in 1:length(w_list)];\n\np = run_simulation(50, :quasirandom, w_transformed, K_transformed)","category":"page"},{"location":"API/#API","page":"API","title":"API","text":"","category":"section"},{"location":"API/#Coordinates","page":"API","title":"Coordinates","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"Ω\nA_generate\ntransform_list\nshift\nw_gen\ntransform_coordinates\ntransform_back","category":"page"},{"location":"API/#FewBodyPhysics.Ω","page":"API","title":"FewBodyPhysics.Ω","text":"Ω(masses::Array)\n\nCalculate the Jacobi transformation matrix J and its inverse U for a system of particles with specified masses.\n\nArguments\n\nmasses::Array: A vector of masses for the particles.\n\nReturns\n\nJ::Matrix: The Jacobi transformation matrix.\nU::Matrix: The inverse of the Jacobi transformation matrix.\n\nNotes\n\nFor systems with more than one particle, the returned matrices exclude the last row/column for proper dimensionality in transformations.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.A_generate","page":"API","title":"FewBodyPhysics.A_generate","text":"A_generate(bij::Array, w_list::Array)\n\nGenerate a matrix A for Gaussian basis functions given width parameters bij and weight vectors w_list.\n\nArguments\n\nbij::Array: A vector of width parameters for the Gaussian basis functions.\nw_list::Array: A list of weight vectors.\n\nReturns\n\nMatrix: The sum of weighted outer products of w_list, scaled by bij.\n\nNotes\n\nThis function is used to construct basis elements for the expansion of few-body wavefunctions.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_list","page":"API","title":"FewBodyPhysics.transform_list","text":"transform_list(α::Array)\n\nTransform a list of scalar values α into a list of 1x1 matrices.\n\nArguments\n\nα::Array: A list of scalar values.\n\nReturns\n\nArray: A list of 1x1 matrices where each matrix contains one of the scalar values from α.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.shift","page":"API","title":"FewBodyPhysics.shift","text":"shift(a::Array, b::Array, mat::Matrix=I)\n\nCalculate the weighted sum of the element-wise product of vectors a and b using matrix mat.\n\nArguments\n\na::Array: A vector or matrix.\nb::Array: A vector or matrix of the same size as a.\nmat::Matrix: An optional matrix to weight the product (default is the identity matrix).\n\nReturns\n\nFloat64: The weighted sum of products.\n\nNotes\n\na and b are typically shift vectors in the configuration space of a few-body system.\nIf mat is provided, its dimensions must match the number of elements in a and b.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.w_gen","page":"API","title":"FewBodyPhysics.w_gen","text":"w_gen(dim::Int, i::Int, j::Int)\n\nGenerate a weight vector for the i-th and j-th coordinates in a space of dimension dim.\n\nArguments\n\ndim::Int: The dimension of the space.\ni::Int: The index for the positive element in the weight vector.\nj::Int: The index for the negative element in the weight vector.\n\nReturns\n\nVector{Int}: A vector with 1 at the i-th position, -1 at the j-th position, and 0 elsewhere.\n\nNotes\n\nThis function is useful for generating basis vectors in few-body coordinate transformations.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_coordinates","page":"API","title":"FewBodyPhysics.transform_coordinates","text":"transform_coordinates(Ω::Matrix{Float64}, r::Vector{Float64})\n\nTransform the coordinates r of a system using the Jacobi matrix Ω.\n\nArguments\n\nΩ::Matrix{Float64}: The Jacobi transformation matrix.\nr::Vector{Float64}: The coordinates to be transformed.\n\nReturns\n\nVector{Float64}: The transformed coordinates.\n\nNotes\n\nThis function applies the inverse of Jacobi matrix J to the coordinate vector r.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.transform_back","page":"API","title":"FewBodyPhysics.transform_back","text":"transform_back(Ω::Matrix{Float64}, x::Matrix{Float64})\n\nTransform the coordinates x back to the original system using the inverse of the Jacobi matrix Ω.\n\nArguments\n\nΩ::Matrix{Float64}: The Jacobi transformation matrix.\nx::Matrix{Float64}: The coordinates to be transformed back.\n\nReturns\n\nMatrix{Float64}: The coordinates transformed back to the original system.\n\nNotes\n\nThis function applies the inverse of matrix U to the coordinate matrix x.\n\n\n\n\n\n","category":"function"},{"location":"API/#Matrix-elements","page":"API","title":"Matrix elements","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"S_elements\nS_wave\nS_energy\nP_elements\npion_nucleon\nComputeEigenSystem\nGetMinimumEnergy\nOptimizeGlobalParameters","category":"page"},{"location":"API/#FewBodyPhysics.S_elements","page":"API","title":"FewBodyPhysics.S_elements","text":"S_elements(A, B, K, w=nothing)\n\nCalculate matrix elements for overlap, kinetic energy, and optionally the Coulomb term.\n\nArguments\n\nA::Matrix: Matrix representing the width of Gaussian basis functions for state i.\nB::Matrix: Matrix representing the width of Gaussian basis functions for state j.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\nM0::Float64: The overlap matrix element between the two states.\ntra::Float64: The trace used in the kinetic energy calculation.\nCoulomb_term::Float64 (optional): The Coulomb interaction term, if weight vectors w are provided.\n\nNotes\n\nThe Coulomb term is calculated only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.S_wave","page":"API","title":"FewBodyPhysics.S_wave","text":"S_wave(α, K, w=nothing)\n\nCalculate the wavefunction overlap, kinetic energy, and optionally Coulomb interaction matrices for a given set of basis functions.\n\nArguments\n\nα::Vector: A list of scalar width parameters for the Gaussian basis functions.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\noverlap::Matrix: The overlap matrix for the basis functions.\nkinetic::Matrix: The kinetic energy matrix for the basis functions.\nCoulomb::Matrix (optional): The Coulomb interaction matrix, if weight vectors w are specified.\n\nNotes\n\nThe Coulomb matrix is computed only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.S_energy","page":"API","title":"FewBodyPhysics.S_energy","text":"S_energy(bij, K, w)\n\nCompute the ground state energy of the system using the basis functions specified by the width parameters bij.\n\nArguments\n\nbij::Vector: A list of width parameters for the Gaussian basis functions.\nK::Matrix: Kinetic energy matrix.\nw::Vector: Weight vectors for the particles involved.\n\nReturns\n\nE0::Float64: The lowest eigenvalue computed from the Hamiltonian, considered as the ground state energy of the system.\n\nNotes\n\nThis function constructs the Hamiltonian from the overlap, kinetic, and Coulomb matrices and solves for its eigenvalues.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.P_elements","page":"API","title":"FewBodyPhysics.P_elements","text":"P_elements(a, b, A, B, K, w=nothing)\n\nCalculate the perturbation matrix elements given two basis states represented by vectors a and b, and their respective width matrices A and B.\n\nArguments\n\na::Vector: The coefficient vector for basis state i.\nb::Vector: The coefficient vector for basis state j.\nA::Matrix: Matrix representing the width of Gaussian basis functions for state i.\nB::Matrix: Matrix representing the width of Gaussian basis functions for state j.\nK::Matrix: Kinetic energy matrix.\nw::Vector (optional): Weight vectors for the particles involved.\n\nReturns\n\nM1::Float64: The overlap perturbation term.\nkinetic::Float64: The kinetic energy perturbation term.\nCoulomb_term::Float64 (optional): The Coulomb interaction perturbation term, if weight vectors w are provided.\n\nNotes\n\nThe Coulomb interaction perturbation term is calculated only if the weight vectors w are specified.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.pion_nucleon","page":"API","title":"FewBodyPhysics.pion_nucleon","text":"pion_nucleon(alphas, masses, params)\n\nCalculate the overlap and kinetic matrices for a pion-nucleon system.\n\nArguments\n\nalphas: A vector of alpha values, which are parameters related to the Gaussian basis functions.\nmasses: A 2-element vector containing the masses of the nucleon and the pion, respectively.\nparams: A 2-element vector containing the parameters b and S.\n\nReturns\n\noverlap: A matrix representing the overlap between the basis functions.\nkinetic: A matrix representing the kinetic energy elements.\n\nDescription\n\nThe function calculates the overlap and kinetic matrices for a pion-nucleon system using Gaussian basis functions. The overlap matrix elements are calculated as integrals of the product of two basis functions, and the kinetic matrix elements are calculated as integrals of the product of the derivatives of two basis functions.\n\nThe function uses the reduced mass of the pion-nucleon system, the parameter b related to the width of the Gaussian functions, and the parameter S related to the amplitude of the Gaussian functions.\n\nThe matrices are symmetric, and the diagonal elements of the overlap matrix are 1. The off-diagonal elements are calculated using the alpha parameters and the b and S parameters.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.ComputeEigenSystem","page":"API","title":"FewBodyPhysics.ComputeEigenSystem","text":"ComputeEigenSystem(bs, masses, params)\n\nCalculate the eigenvalues and eigenvectors of a system defined by parameters bs, masses, and params.\n\nArguments\n\nbs: Array of parameter values used in the computation.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters required for the calculation.\n\nReturns\n\nTuple of eigenvalues (E) and eigenvectors (c).\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.GetMinimumEnergy","page":"API","title":"FewBodyPhysics.GetMinimumEnergy","text":"GetMinimumEnergy(bs, masses, params)\n\nCompute the minimum energy of a system characterized by bs, masses, and params.\n\nArguments\n\nbs: Array of parameter values used in the computation.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters required for the calculation.\n\nReturns\n\nMinimum energy value of the system.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.OptimizeGlobalParameters","page":"API","title":"FewBodyPhysics.OptimizeGlobalParameters","text":"OptimizeGlobalParameters(ngauss, dim, bmax, masses, params)\n\nPerform global optimization over a given parameter space to find optimal parameters for a physical system.\n\nArguments\n\nngauss: Number of Gaussian functions used in the optimization.\ndim: Dimensionality of the parameter space.\nbmax: Maximum value of the parameter b.\nmasses: Array of masses, representing physical properties of the system.\nparams: Additional parameters used in the optimization.\n\nReturns\n\nE_list: List of optimized energies.\ngaussians: List of Gaussian functions used.\ncoords: Optimized coordinates in the parameter space.\neigenvectors: Eigenvectors corresponding to the optimized coordinates.\nmasses: Updated masses array.\n\n\n\n\n\n","category":"function"},{"location":"API/#Sampling","page":"API","title":"Sampling","text":"","category":"section"},{"location":"API/","page":"API","title":"API","text":"corput\nhalton\nrun_simulation\nrun_simulation_nuclear","category":"page"},{"location":"API/#FewBodyPhysics.corput","page":"API","title":"FewBodyPhysics.corput","text":"Generate the nth element of the van der Corput sequence in base b.\n\nArguments\n\nn: The nth element of the sequence to be generated.\nb: The base for the van der Corput sequence. Default is 3.\n\nReturns\n\nq: The nth element of the van der Corput sequence in base b.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.halton","page":"API","title":"FewBodyPhysics.halton","text":"Generate the nth d-dimensional point in the Halton sequence.\n\nArguments\n\nn: The nth element of the sequence to be generated.\nd: The dimension of the space.\n\nReturns\n\nAn array containing the nth d-dimensional point in the Halton sequence.\n\nErrors\n\nThrows an assertion error if d exceeds the number of basis elements.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.run_simulation","page":"API","title":"FewBodyPhysics.run_simulation","text":"Run the simulation for a quantum system using quasi-random or pseudo-random methods to determine the S-wave convergence.\n\nArguments\n\nnum_gauss::Int: The number of Gaussians to use in the simulation. Default is 15.\nmethod::Symbol: The method to use for the simulation. Can be :quasirandom, :quasirandomrefined, or :psudorandom. Default is :quasirandom.\nplot_result::Bool: Whether to plot the results. Default is true.\n\nReturns\n\np: The plot object if plot_result is true.\n\nNotes\n\nThe function prints various convergence information and, if plot_result is true, displays a plot of the numerical result against the theoretical value.\n\n\n\n\n\n","category":"function"},{"location":"API/#FewBodyPhysics.run_simulation_nuclear","page":"API","title":"FewBodyPhysics.run_simulation_nuclear","text":"run_simulation_nuclear(ngauss=2, dim=2, bmax=5)\n\nRun a nuclear simulation and print the final energy.\n\nArguments\n\nngauss: Number of Gaussian functions to use in the simulation (default is 2).\ndim: Dimension of the simulation (default is 2).\nbmax: Maximum impact parameter (default is 5).\n\nOutputs\n\nPrints the final energy of the simulation.\n\nExample\n\n```julia runsimulationnuclear(3, 3, 10)\n\n\n\n\n\n","category":"function"}] } diff --git a/dev/theory/index.html b/dev/theory/index.html new file mode 100644 index 0000000..04f6d31 --- /dev/null +++ b/dev/theory/index.html @@ -0,0 +1,13 @@ + +Theory · FewBodyPhysics.jl

Theory

Basis expansion of the Schrödinger equation

We are going to solve the Schrödinger equation

\[\hat{H}|\psi\rangle = \epsilon|\psi\rangle,\]

where $\hat{H}$ is the Hamiltonian of a quantum few-body system, $|\psi\rangle$ and $\epsilon$ are the eigenfunction and the eigenvalue to be found.

We shall expand the wave-function $|\psi\rangle$ in terms of a set of basis functions $|i\rangle$ for $i = 1 \ldots n$,

\[|\psi\rangle = \sum_{i=1}^{n} c_i |i\rangle.\]

Inserting the expansion into the Schrödinger equation and multiplying from the left with $\langle k|$ for $1 \leq k \leq n$ gives

\[\sum_{i=1}^{n} \langle k|\hat{H}|i\rangle c_i = \epsilon \sum_{i=1}^{n} \langle k|i\rangle c_i.\]

Or, in the matrix notation

\[Hc = \epsilon Nc,\]

where $H$ and $N$ are correspondingly the Hamiltonian and the overlap matrices with the matrix elements

\[H_{ki} = \langle k|\hat{H}|i\rangle, \quad N_{ki}\]

Gaussians as basis functions

We shall use the so-called Correlated Gaussians (or Explicitly Correlated Gaussians) as the basis functions. For a system of $N$ particles with coordinates $\vec{r}_i$, $i = 1 \ldots N$, the Correlated Gaussian is defined as

\[g(\vec{r}_1, \ldots, \vec{r}_N) = \exp \left( - \sum_{i,j=1}^{N} A_{ij}\vec{r}_i \cdot \vec{r}_j - \sum_{i=1}^{N} \vec{s}_i \cdot \vec{r}_i \right),\]

where $\vec{r}_i \cdot \vec{r}_j$ denotes the dot-product of the two vectors; and where $A$, a symmetric positive-defined matrix, and $\vec{s}_i$, $i=1,\ldots,N$, the shift-vectors, are (cleverly chosen) parameters of the Gaussian.

In matrix notation,

\[g(\vec{r}) = \exp \left( -\vec{r}^T A \vec{r} + \vec{s}^T \vec{r} \right),\]

where $\vec{r}$ is the column of the coordinates $\vec{r}_i$ and $\vec{s}$ is the column of the shift-vectors $\vec{s}_i$,

\[\vec{r} = +\begin{pmatrix} +\vec{r}_1 \\ +\vdots \\ +\vec{r}_N +\end{pmatrix}, \quad +\vec{s} = +\begin{pmatrix} +\vec{s}_1 \\ +\vdots \\ +\vec{s}_N +\end{pmatrix},\]

and

\[\vec{r}^T A \vec{r} + \vec{s}^T \vec{r} = \sum_{i,j} \vec{r}_i \cdot A_{ij}\vec{r}_j + \sum_i \vec{s}_i \cdot \vec{r}_i.\]