Giter VIP home page Giter VIP logo

neuralquantum.jl's Introduction

NeuralQuantum

Build Status DOI

NeuralQuantum is a numerical framework written in Julia to investigate Neural-Network representations of mixed quantum states and to find the Steady- State of dissipative Quantum Systems with variational Montecarlo schemes. It can also compute the ground state of hermitian hamiltonians.

This code has been developed while working on Variational neural network ansatz for steady states in open quantum systems, by F. Vicentini et al. Phys Rev Lett 122, 250503 (2019).

Installation

To Install NeuralQuantum.jl, run the following commands to install it's dependcy. Please note that we require julia >= 1.3, and relatively recent versions of several packages.

using Pkg
pkg"add https://github.com/PhilipVinc/NeuralQuantum.jl"

Alternatively you may activate the project included in the manifest that comes with NeuralQuantum.

Examples

Check the folder Examples/ for a few interesting examples.

neuralquantum.jl's People

Contributors

philipvinc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neuralquantum.jl's Issues

Energy of Bose Hubbard System does not converge to the exact value.

Hi, actually I am trying to reproduce the Saito's paper with NeuralQuantum.jl. However, I am getting energy values that do not match with the values reported in this paper.
Here is the code

`
nsites = 11
nbosons = 9
U = 2.0
J = 1.0
V = (collect(0:10).-5).^2

hilb = HomogeneousFock( nsites, nbosons )
H = LocalOperator( hilb )

for i in 1:nsites
    ni = number( hilb, i)
    ai = destroy( hilb, mod1(i,nsites) )
    adip1 = create( hilb, mod1(i+1,nsites))
    adim1 = create( hilb, mod1(i-1,nsites))
    H +=  V[i]*ni + U/2*(ni*ni - ni)
    H -= J*ai*adip1
    H -= J*ai*adim1
end

ai = LocalOperator( hilb )
for i in 1:nsites
    ai += destroy( hilb, mod1(i,nsites) )
end

net = RBM( Float64, nsites, 1, af_logcosh )

init_random_pars!( net, sigma=0.1 )
sampler = MetropolisSampler( LocalRule(), 1000, nsites, burn=100 )
algo = SR( ϵ = (0.01), algorithm = sr_cg, precision = 1e-3 )

is = BatchedSampler( net, sampler, H, algo; batch_sz=16 )
add_observable!( is, "ai", ai )
optimizer = Optimisers.Descent(0.01)

Evalues = Float64[];
Eerr = Float64[];

for i=1:epochs
    ldata, prec = sample!(is)
    global ob = compute_observables(is)

    push!( Evalues, real(ldata.mean) )
    push!( Eerr, ldata.error )
    grad = precondition!( prec, algo, i )
    Optimisers.update!( optimizer, net, grad )

    @show i, real( ldata.mean )
end

Evalues

`

I would like to know if I am making a mistake.

Installing on Mac M1

I'm trying to install the library using Julia 1.7 with an arm64 arch in a Mac M1. However, I get the following error:

ERROR: Error building `NNlib`: 
┌ Warning: Platform `arm64-apple-darwin21.2.0` is not an officially supported platform
└ @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:450
ERROR: LoadError: KeyError: key "unknown" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:481 [inlined]
  [2] parse_dl_name_version
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:511 [inlined]
  [3] detect_libgfortran_abi(libgfortran_name::String, platform::BinaryProvider.UnknownPlatform) (repeats 2 times)
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:555
  [4] detect_libgfortran_abi
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:584 [inlined]
  [5] detect_compiler_abi()
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:667
  [6] top-level scope
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:685
  [7] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [8] include(x::String)
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:1
  [9] top-level scope
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:12
 [10] include
    @ ./Base.jl:418 [inlined]
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1318
 [12] top-level scope
    @ none:1
 [13] eval
    @ ./boot.jl:373 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [15] top-level scope
    @ none:1
in expression starting at /Users/vladimirvargas/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:685
in expression starting at /Users/vladimirvargas/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:1
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to /Users/vladimirvargas/.julia/compiled/v1.7/BinaryProvider/jl_EBDAtU.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [8] top-level scope
   @ none:5
in expression starting at /Users/vladimirvargas/.julia/packages/NNlib/FAI3o/deps/build.jl:1

This looks to be an error triggered by BinaryProvider as explained here. Latest release was on 2020 before the Mac M1 was released. Apparently the guys from PastaQ reported the same installation issue, but it looks like they were able to find a fix with this PR.

I wonder if a fix like this could be made here. Thanks. I really don't want to go back to using Rosetta again 😄 I don't know if such a fix could be written in NNLib directly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.