From 443aaae3919955ff648313942dcc5d76f1d07f25 Mon Sep 17 00:00:00 2001 From: ysyapa Date: Fri, 18 Aug 2023 20:45:33 +0000 Subject: [PATCH] Testing script --- testing-irrep.ipynb | 51 --------------------------------------------- testing.jl | 23 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 51 deletions(-) delete mode 100644 testing-irrep.ipynb create mode 100644 testing.jl diff --git a/testing-irrep.ipynb b/testing-irrep.ipynb deleted file mode 100644 index 90112e0..0000000 --- a/testing-irrep.ipynb +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "include(\"Hamiltonian.jl\")\n", - "\n", - "println(\"Running with \",Threads.nthreads(),\" thread(s)\")\n", - "\n", - "T=Float32\n", - "\n", - "function V_test(r2)\n", - " return -4*exp(-r2/4)\n", - "end\n", - "\n", - "n = 2\n", - "N = 16\n", - "println(\"\\n$n-body system with N=$N\")\n", - "\n", - "for L::T in 5.0:9.0\n", - " println(\"L=$L\")\n", - " println(\"Constructing Hamiltonian\")\n", - " s=system{T}(3,n,N,L,0.5,all)\n", - " @time H=Hamiltonian{T}(s,V_test,0,0,cpu_tensor)\n", - " println(\"Solving eigenvalues\")\n", - " @time evals,_,_ = eig(H,5)\n", - " println(real.(evals))\n", - "end" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Julia 1.9.0", - "language": "julia", - "name": "julia-1.9" - }, - "language_info": { - "file_extension": ".jl", - "mimetype": "application/julia", - "name": "julia", - "version": "1.9.0" - }, - "orig_nbformat": 4 - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/testing.jl b/testing.jl new file mode 100644 index 0000000..7a8c07a --- /dev/null +++ b/testing.jl @@ -0,0 +1,23 @@ +include("Hamiltonian.jl") + +println("Running with ",Threads.nthreads()," thread(s)") + +T=Float32 + +function V_test(r2) + return -4*exp(-r2/4) +end + +n = 2 +N = 16 +println("\n$n-body system with N=$N") + +for L::T in 5.0:9.0 + println("L=$L") + println("Constructing Hamiltonian") + s=system{T}(3,n,N,L,0.5,all) + @time H=Hamiltonian{T}(s,V_test,0,0,cpu_tensor) + println("Solving eigenvalues") + @time evals,_,_ = eig(H,5) + println(real.(evals)) +end \ No newline at end of file