Compare commits
No commits in common. "main" and "calculations" have entirely different histories.
main
...
calculatio
|
|
@ -1,6 +1,3 @@
|
||||||
# VSCode
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# HPC scripts and logs
|
# HPC scripts and logs
|
||||||
hpc/
|
hpc/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@ end
|
||||||
|
|
||||||
"cuTENSOR contraction and accumulation (C = A * B + C)"
|
"cuTENSOR contraction and accumulation (C = A * B + C)"
|
||||||
function contract_accumulate!(C::CuTensor, A::CuTensor, B::CuTensor)::CuTensor
|
function contract_accumulate!(C::CuTensor, A::CuTensor, B::CuTensor)::CuTensor
|
||||||
cuTENSOR.contraction!(one(eltype(C)), A.data, A.inds, cuTENSOR.CUTENSOR_OP_IDENTITY, B.data, B.inds, cuTENSOR.CUTENSOR_OP_IDENTITY,
|
CUTENSOR.contraction!(one(eltype(C)), A.data, A.inds, CUTENSOR.CUTENSOR_OP_IDENTITY, B.data, B.inds, CUTENSOR.CUTENSOR_OP_IDENTITY,
|
||||||
one(eltype(C)), C.data, C.inds, cuTENSOR.CUTENSOR_OP_IDENTITY, cuTENSOR.CUTENSOR_OP_IDENTITY)
|
one(eltype(C)), C.data, C.inds, CUTENSOR.CUTENSOR_OP_IDENTITY, CUTENSOR.CUTENSOR_OP_IDENTITY)
|
||||||
return C
|
return C
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[TensorOperations]
|
|
||||||
precompile_workload = true
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
[deps]
|
|
||||||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
|
|
||||||
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
|
|
||||||
NVTX = "5da4648a-3479-48b8-97b9-01cb529c0a1f"
|
|
||||||
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
|
|
||||||
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
|
|
||||||
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"
|
|
||||||
27
README.md
27
README.md
|
|
@ -1,27 +0,0 @@
|
||||||
# DVR-jl
|
|
||||||
|
|
||||||
Solves the quantum $n$-body problem in finite volume (lattice) with periodic boundary conditions. Uses discrete variable representation (DVR) with optional support for complex scaling to study resonances. All details can be found in [H. Yu, N. Yapa, and S. König, Complex scaling in finite volume, Phys. Rev. C 109, 014316 (2024)](https://doi.org/10.1103/PhysRevC.109.014316).
|
|
||||||
|
|
||||||
Written in Julia with optional CUDA GPU acceleration (experimental).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Make sure you have Julia installed. Required packages can be installed with a single command:
|
|
||||||
```bash
|
|
||||||
julia --project=. -e 'import Pkg; Pkg.instantiate()'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
See `calculations/3b_bound.jl` for an example on a 3-body bound state.
|
|
||||||
See `calculations/3b_res_from_paper.jl` for an example of a 3-body resonance via complex scaling.
|
|
||||||
|
|
||||||
## Planned features
|
|
||||||
|
|
||||||
- [ ] Spin and isospin degrees of freedom for nuclear calculations
|
|
||||||
- [ ] Multi-node HPC support
|
|
||||||
- [ ] Parity and cubic symmetries ($S_4$)
|
|
||||||
|
|
||||||
## Acknowledgments
|
|
||||||
|
|
||||||
The author gratefully acknowledges the guidance from Sebastian König.
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
using Plots, Arpack
|
|
||||||
|
|
||||||
include("../helper.jl")
|
|
||||||
include("../Hamiltonian.jl")
|
|
||||||
|
|
||||||
mode = cpu_tensor
|
|
||||||
T = Float32 # single-precision mode
|
|
||||||
|
|
||||||
V_r2(c) = r2 -> c * (-5 * exp(-r2/3) + 2 * exp(-r2/10))
|
|
||||||
|
|
||||||
d = 3
|
|
||||||
n = 2
|
|
||||||
N = 48
|
|
||||||
L = 30
|
|
||||||
ϕ = pi/6
|
|
||||||
n_imag = 1
|
|
||||||
s = system{T}(d, n, N, L)
|
|
||||||
|
|
||||||
train_cs = range(0.78, 0.45, length=5)
|
|
||||||
train_ref = reverse([0.05387926313545913-0.008900278182520881im,
|
|
||||||
0.11254295298924327-0.020515067379548786im,
|
|
||||||
0.16060154707503538-0.03716539208626717im,
|
|
||||||
0.19741353362674618-0.05994519982799412im,
|
|
||||||
0.2219100763497223-0.08959449893439568im])
|
|
||||||
|
|
||||||
extrapolate_cs = range(0.38, 0.22, length=5)
|
|
||||||
extrapolate_ref = reverse([0.23165109150003316-0.12052751440975719im,
|
|
||||||
0.23190549514995962-0.1406687118589838im,
|
|
||||||
0.22763660218046278-0.1626190970863793im,
|
|
||||||
0.21807104244164865-0.18635600686249373im,
|
|
||||||
0.2020979906072586-0.21180157628258728im])
|
|
||||||
|
|
||||||
training_E = ComplexF64[]
|
|
||||||
training_vec = Array[]
|
|
||||||
exact_E = ComplexF64[]
|
|
||||||
extrapolated_E = ComplexF64[]
|
|
||||||
|
|
||||||
for c in train_cs
|
|
||||||
println("Training c=", c)
|
|
||||||
H = Hamiltonian{T}(s, V_r2(c), ϕ, n_imag, mode)
|
|
||||||
@time evals, evecs, info = eig(H, 20, resonances = true)
|
|
||||||
i = nearestIndex(evals, pop!(train_ref))
|
|
||||||
push!(training_E, evals[i])
|
|
||||||
push!(training_vec, evecs[i])
|
|
||||||
end
|
|
||||||
|
|
||||||
N_EC = [sum(x .* y) for (x, y) in Iterators.product(training_vec, training_vec)]
|
|
||||||
|
|
||||||
for c in extrapolate_cs
|
|
||||||
println("Extrapolating c=", c)
|
|
||||||
H = Hamiltonian{T}(s, V_r2(c), ϕ, n_imag, mode)
|
|
||||||
@time evals, _, info = eig(H, 40, resonances = true)
|
|
||||||
nearestE = nearest(evals, pop!(extrapolate_ref))
|
|
||||||
push!(exact_E, nearestE)
|
|
||||||
|
|
||||||
# EC extrapolation
|
|
||||||
H_training_vec = H.(training_vec)
|
|
||||||
H_EC = [sum(x .* y) for (x, y) in Iterators.product(training_vec, H_training_vec)]
|
|
||||||
|
|
||||||
evals = eigvals(H_EC, N_EC)
|
|
||||||
push!(extrapolated_E, nearestE)
|
|
||||||
end
|
|
||||||
|
|
||||||
scatter(real.(training_E), imag.(training_E), label="training")
|
|
||||||
scatter!(real.(exact_E), imag.(exact_E), label="exact")
|
|
||||||
scatter!(real.(extrapolated_E), imag.(extrapolated_E), label="extrapolated")
|
|
||||||
savefig("temp/EC-R2R-S.pdf")
|
|
||||||
Loading…
Reference in New Issue