Skip to content

Commit

Permalink
Merge pull request #63 from k-ido/test_rbm
Browse files Browse the repository at this point in the history
add test
  • Loading branch information
tmisawa authored Oct 1, 2024
2 parents 5ba89e0 + c36820d commit 14f95a6
Show file tree
Hide file tree
Showing 19 changed files with 2,108 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/runtest.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/runtest_mode1.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/runtest_mpi.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/runtest_expert.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/runtest_UHF.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_UHF_InterAll.py DESTINATION ${CMAKE_BINARY_DIR}/test/python)

Expand All @@ -19,6 +20,11 @@ function(add_python_vmc_test_mpi model)
set_tests_properties(${model} PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/test/python")
endfunction(add_python_vmc_test_mpi)

function(add_python_vmc_test_expert model)
add_test(NAME ${model} COMMAND ${PYTHON_EXECUTABLE} runtest_expert.py ${model})
set_tests_properties(${model} PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/test/python")
endfunction(add_python_vmc_test_expert)

function(add_python_uhf_test model)
add_test(NAME ${model} COMMAND ${PYTHON_EXECUTABLE} runtest_UHF.py ${model})
set_tests_properties(${model} PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/test/python")
Expand Down Expand Up @@ -61,13 +67,17 @@ set(python_test_vmc_model_mode1
HubbardChainLanczos
)

set(python_test_vmc_model_expert
GeneralRBM_cmp
)

set(python_test_uhf_model
UHF_HubbardSquare
UHF_HubbardTriangular
UHF_InterAll_N2
)


foreach(model ${python_test_vmc_model})
add_python_vmc_test(${model})
endforeach(model)
Expand All @@ -80,6 +90,10 @@ foreach(model ${python_test_vmc_model_mode1})
add_python_vmc_test_mode1(${model})
endforeach(model)

foreach(model ${python_test_vmc_model_expert})
add_python_vmc_test_expert(${model})
endforeach(model)

foreach(model ${python_test_uhf_model})
add_python_uhf_test(${model})
endforeach(model)
Expand Down
15 changes: 15 additions & 0 deletions test/python/data/GeneralRBM_cmp/coulombintra.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=============================================
NCoulombIntra 10
=============================================
================== CoulombIntra ================
=============================================
0 8.000000000000000
1 8.000000000000000
2 8.000000000000000
3 8.000000000000000
4 8.000000000000000
5 8.000000000000000
6 8.000000000000000
7 8.000000000000000
8 8.000000000000000
9 8.000000000000000
25 changes: 25 additions & 0 deletions test/python/data/GeneralRBM_cmp/greenone.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
===============================
NCisAjs 20
===============================
======== Green functions ======
===============================
0 0 0 0
0 0 1 0
0 0 2 0
0 0 3 0
0 0 4 0
0 0 5 0
0 0 6 0
0 0 7 0
0 0 8 0
0 0 9 0
0 1 0 1
0 1 1 1
0 1 2 1
0 1 3 1
0 1 4 1
0 1 5 1
0 1 6 1
0 1 7 1
0 1 8 1
0 1 9 1
65 changes: 65 additions & 0 deletions test/python/data/GeneralRBM_cmp/greentwo.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
=============================================
NCisAjsCktAltDC 60
=============================================
======== Green functions for Sq AND Nq ======
=============================================
0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 1
0 0 0 0 1 0 1 0
0 0 0 0 1 1 1 1
0 0 0 0 2 0 2 0
0 0 0 0 2 1 2 1
0 0 0 0 3 0 3 0
0 0 0 0 3 1 3 1
0 0 0 0 4 0 4 0
0 0 0 0 4 1 4 1
0 0 0 0 5 0 5 0
0 0 0 0 5 1 5 1
0 0 0 0 6 0 6 0
0 0 0 0 6 1 6 1
0 0 0 0 7 0 7 0
0 0 0 0 7 1 7 1
0 0 0 0 8 0 8 0
0 0 0 0 8 1 8 1
0 0 0 0 9 0 9 0
0 0 0 0 9 1 9 1
0 0 0 0 0 1 0 1
0 0 1 0 1 1 0 1
0 0 2 0 2 1 0 1
0 0 3 0 3 1 0 1
0 0 4 0 4 1 0 1
0 0 5 0 5 1 0 1
0 0 6 0 6 1 0 1
0 0 7 0 7 1 0 1
0 0 8 0 8 1 0 1
0 0 9 0 9 1 0 1
0 1 0 1 0 0 0 0
0 1 1 1 1 0 0 0
0 1 2 1 2 0 0 0
0 1 3 1 3 0 0 0
0 1 4 1 4 0 0 0
0 1 5 1 5 0 0 0
0 1 6 1 6 0 0 0
0 1 7 1 7 0 0 0
0 1 8 1 8 0 0 0
0 1 9 1 9 0 0 0
0 1 0 1 0 0 0 0
0 1 0 1 0 1 0 1
0 1 0 1 1 0 1 0
0 1 0 1 1 1 1 1
0 1 0 1 2 0 2 0
0 1 0 1 2 1 2 1
0 1 0 1 3 0 3 0
0 1 0 1 3 1 3 1
0 1 0 1 4 0 4 0
0 1 0 1 4 1 4 1
0 1 0 1 5 0 5 0
0 1 0 1 5 1 5 1
0 1 0 1 6 0 6 0
0 1 0 1 6 1 6 1
0 1 0 1 7 0 7 0
0 1 0 1 7 1 7 1
0 1 0 1 8 0 8 0
0 1 0 1 8 1 8 1
0 1 0 1 9 0 9 0
0 1 0 1 9 1 9 1
16 changes: 16 additions & 0 deletions test/python/data/GeneralRBM_cmp/gutzwilleridx.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=============================================
NGutzwillerIdx 1
ComplexType 0
=============================================
=============================================
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
0 1
1 change: 1 addition & 0 deletions test/python/data/GeneralRBM_cmp/initial.def
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.141928120671135183e+01 2.802141748193133497e-02 1.433028696512933742e+00 1.821768981883505489e+02 0.000000000000000000e+00 4.827545218644152669e+01 -1.040746446292785676e-01 0.000000000000000000e+00 7.096273242956433781e-03 2.321261317285507747e-02 0.000000000000000000e+00 1.698493317307660537e-03 2.401259212907888227e-02 0.000000000000000000e+00 1.394432555957268857e-03 1.485571471295256407e-02 0.000000000000000000e+00 1.067887056545590912e-03 2.803807359486053946e-02 0.000000000000000000e+00 4.078906747066205103e-03 1.395565101953150089e-02 0.000000000000000000e+00 1.143446433920292929e-03 5.505499113518438209e-04 -5.163804247029171344e-04 0.000000000000000000e+00 5.172394703804498485e-03 3.831282890132404074e-03 0.000000000000000000e+00 -3.451992033500094620e-02 -1.338520540903842190e-02 1.139372257546324672e-02 -2.079799294758274270e-02 -2.639346344666517255e-02 1.872968668116896385e-02 -1.520263515060717857e-02 3.655661187071228280e-02 1.060782422510961331e-02 -3.465155520283447199e-02 -7.692051752869212555e-02 1.810694952327393872e-03 3.201811340227254249e-02 2.176924944650117377e-02 2.380345185519919596e-03 -6.417667550222630468e-02 1.004314767885620616e-02 3.420442582421810533e-03 -9.310714127878467680e-03 -2.716220702598887149e-02 5.177402478696417794e-03 1.726170432542478012e-02 -2.335296475860131754e-02 6.854614297036322815e-03 -1.213876779717242352e-02 -8.627011149628042996e-03 5.427712004285082173e-03 3.714963191880824023e-02 -2.869050889857973491e-03 3.945932809720879841e-03 -8.232497424913168271e-02 4.182894618421030466e-04 4.373607024710911978e-03 3.996343243429947151e-02 5.816714939245767706e-03 3.496878099602109685e-03 -5.711698225990175654e-03 2.503074878297133210e-02 8.922354246503644282e-03 -6.831834277542230688e-04 4.376823457946842078e-02 1.099974568959375190e-02 3.834457099671060437e-02 3.918553715039099772e-02 2.202984772396846848e-03 -3.102289662486091421e-02 8.525831144638024855e-03 3.684364632131887935e-03 -2.414470655542500996e-02 6.347976391362598544e-03 3.569622886730173389e-03 2.616270352868596549e-02 -2.655674797266022527e-02 2.238270213989674608e-03 3.888630919584464690e-02 -3.480934799018314384e-03 4.583610184923050945e-03 -3.008719490823338200e-02 -1.770782193906386692e-02 2.905255735497308707e-03 -1.892360875324868019e-02 6.729812743978946799e-02 5.485002369090562907e-03 -3.732874192912069740e-03 3.960680478813945193e-02 2.118210713666419942e-03 -4.591882142263598726e-03 -8.485678839344960867e-02 5.714589902026061437e-03 1.135075583939156897e-02 -6.908608461242149446e-02 7.747362773017123444e-04 -3.127342102220333209e-02 3.072845702072575687e-03 1.060686999310754075e-03 2.416973427558911230e-02 -2.566860616010065849e-02 5.415160442910392849e-03 -2.600785024430673359e-02 -6.041292192829282592e-02 3.241706542055214964e-03 2.770090581382052969e-02 -3.615826525585009998e-02 2.640398263657633450e-03 2.586666011784636773e-02 -1.899837285153353761e-02 3.350344042254108957e-03 -1.869934014422354462e-02 -2.128960056897061595e-02 5.701043686568762169e-03 3.569332577215589275e-02 4.694566992724869686e-02 2.363211715841260444e-03 -1.738549369475538009e-02 4.239767036205979722e-02 1.345788448057489870e-03 4.729598835142830547e-03 4.918759262466169957e-02 5.530014472180510166e-04 -9.694321039949729824e-03 7.133144925394498126e-02 3.172389453032289051e-03 1.312606142499703026e-02 -2.338431840106400955e-02 9.224096411940435961e-03 -3.657710680620374771e-02 -3.777689701586167681e-02 7.056483704420732361e-03 -3.691288362803027238e-03 -3.983129747726030234e-02 3.834914083884404228e-03 -1.689774726868906868e-02 -3.000752117513153655e-02 4.873510927665758614e-03 5.235736493680000908e-03 3.357224802095511162e-02 2.518294893639385929e-03 -7.262859961418930560e-03 -5.323389028730574762e-03 6.416611593148952714e-03 -7.159864535837155708e-02 -5.026379686273376758e-03 1.962585051356615772e-03 5.023280868568170965e-02 6.799610074253953015e-03 7.642573800761342379e-03 2.282864930923347163e-02 1.240857139782628772e-02 8.245468137514394558e-03 -1.510145426488028811e-02 1.180060239752019763e-02 1.095900732988796741e-03 -1.263549220182812877e-02 -3.105074047502905457e-03 4.396992685949791500e-03 -1.404242052911655950e-03 -1.784882729438471566e-02 3.929836954595231774e-03 1.720869316728895065e-02 1.074429796707349408e-02 4.950197432621188803e-03 -2.569216530506964608e-02 2.236700684848382317e-02 3.956414106896923716e-03 8.678792665745452273e-02 4.855284465005020892e-04 2.942405682600415903e-04 -8.073707254398312938e-02 8.350030618980513152e-04 9.431790735833585695e-03 -4.692517504477679291e-02 4.944410540867966511e-03 3.105191131937954686e-03 2.966853921735565155e-02 1.165720234556016227e-02 4.915882111768419063e-03 -1.140247427761865041e-03 1.103350836544902611e-02 2.628818531210954344e-03 1.391500049242505935e-02 7.242478647486670293e-03 1.840697248537516168e-03 -6.546910317219756248e-02 -3.240701770916859514e-02 3.159699274066988910e-03 6.273583466232948713e-02 -3.841758352627767936e-02 7.581880286278843556e-03 2.584978971409827506e-02 4.071656546727557557e-02 5.581874857616391655e-04 -1.540340271195457435e-03 4.593020650569464014e-02 5.481956846461245349e-03 -6.926998628669512464e-03 -9.773906673674375573e-03 2.452530917109637873e-03 5.982011114980861390e-03 -5.634887528236932376e-03 1.655937025786589564e-03 2.307768388271038210e-02 2.758531618498358696e-03 3.297737739398494058e-03 -1.601247280283466315e-02 1.465132886437300018e-02 7.724657738732813861e-03 2.697939205464002649e-02 -2.466732746581606992e-03 2.068507205910848946e-03 -1.891011332506487789e-03 1.341567643800950678e-02 4.573240864505977339e-03 -3.603446225082733434e-02 -4.269789069776676327e-02 2.580328476120713824e-03 2.223704170587983628e-02 -3.278133078353424879e-02 6.892003865745189792e-03 -3.271036925050151145e-02 3.110119323893837696e-03 2.031275737391126813e-03 4.430131743547069401e-02 -5.823449367845529717e-03 1.338808661505444314e-03 1.800826193445559213e-04 -6.599140063498928899e-02 1.026235077814099256e-02 -1.403856165865128951e-02 -7.425696383481059093e-02 6.673558318415101151e-03 -1.713363820476894450e-02 -4.523205408439753827e-02 6.437915977326667295e-03 1.258324133349269375e-02 -4.094990574935623850e-02 5.800424546843000774e-03 -1.167642325289764207e-02 2.970101651873856621e-02 5.286996744258516331e-03 2.027721229939042323e-03 -6.931917354847860410e-03 4.787976515409251080e-03 6.860549317820507920e-02 3.587302397660091513e-02 1.111138403615714431e-03 -3.538785344294038959e-02 5.062926973912117157e-02 3.815038833830604586e-03 -2.677168750442729395e-03 -9.431593891804613064e-03 4.001803315800892338e-03 2.699070589387385366e-02 -2.416223520779129524e-02 3.468957406011996102e-03 -2.658684535011882413e-02 5.846101797981653227e-03 3.404822526290447911e-03 6.853305124895032324e-03 2.700935898469222080e-02 6.686665253640783346e-03 2.015505538898922089e-02 4.981770155221737495e-02 4.340365186703658285e-03 -1.437068635812715003e-02 5.683938878272370987e-02 4.576359078161450732e-03 4.954043761339094187e-03 5.383178501666745219e-02 4.589611680760159566e-03 -2.393218960374449839e-02 2.362745600202341423e-02 5.787068241826281469e-03 -1.356475443911918433e+00 3.686568160527513349e+00 2.001975834738377313e-02 -1.130029136303810633e+00 2.288633999687052611e+00 2.341279950501813298e-02 -2.172889019213311457e+00 -1.500656847850509124e+00 5.995247674464002779e-02 -1.622746447051708341e-01 1.864831023638547469e+00 5.708349321432313467e-02 7.781391515926943114e-01 -1.931158538020615545e+00 3.236192459423455764e-02 2.249281579510562956e+00 -2.257348352649293233e+00 2.177347380632060209e-02 1.503160427771463414e+00 -2.492253416608015915e+00 4.895700902522335390e-02 1.926008795691006581e+00 3.475466694587693972e+00 4.040745635496435090e-02 1.427024508284702620e+00 3.736697660746418848e+00 5.638613667248226942e-03 6.727518983438759981e-02 3.325070424151021165e+00 2.110913922981159235e-03
100 changes: 100 additions & 0 deletions test/python/data/GeneralRBM_cmp/jastrowidx.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=============================================
NJastrowIdx 5
ComplexType 0
=============================================
=============================================
0 1 0
0 2 1
0 3 2
0 4 3
0 5 4
0 6 3
0 7 2
0 8 1
0 9 0
1 0 0
1 2 0
1 3 1
1 4 2
1 5 3
1 6 4
1 7 3
1 8 2
1 9 1
2 0 1
2 1 0
2 3 0
2 4 1
2 5 2
2 6 3
2 7 4
2 8 3
2 9 2
3 0 2
3 1 1
3 2 0
3 4 0
3 5 1
3 6 2
3 7 3
3 8 4
3 9 3
4 0 3
4 1 2
4 2 1
4 3 0
4 5 0
4 6 1
4 7 2
4 8 3
4 9 4
5 0 4
5 1 3
5 2 2
5 3 1
5 4 0
5 6 0
5 7 1
5 8 2
5 9 3
6 0 3
6 1 4
6 2 3
6 3 2
6 4 1
6 5 0
6 7 0
6 8 1
6 9 2
7 0 2
7 1 3
7 2 4
7 3 3
7 4 2
7 5 1
7 6 0
7 8 0
7 9 1
8 0 1
8 1 2
8 2 3
8 3 4
8 4 3
8 5 2
8 6 1
8 7 0
8 9 0
9 0 0
9 1 1
9 2 2
9 3 3
9 4 4
9 5 3
9 6 2
9 7 1
9 8 0
0 1
1 1
2 1
3 1
4 1
15 changes: 15 additions & 0 deletions test/python/data/GeneralRBM_cmp/locspn.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
================================
NlocalSpin 0
================================
========i_0LocSpn_1IteElc ======
================================
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
33 changes: 33 additions & 0 deletions test/python/data/GeneralRBM_cmp/modpara.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--------------------
Model_Parameters 0
--------------------
VMC_Cal_Parameters
--------------------
CDataFileHead zvo
CParaFileHead zqp
--------------------
NVMCCalMode 0
--------------------
NDataIdxStart 1
NDataQtySmp 1
--------------------
Nsite 10
Ncond 10
2Sz 0
NSPGaussLeg 1
NSPStot 0
NMPTrans 1
NSROptItrStep 1500
NSROptItrSmp 100
DSROptRedCut 1e-10
DSROptStaDel 0.0010000000
DSROptStepDt 0.0030000000
NVMCWarmUp 10
NVMCInterval 1
NVMCSample 100
NExUpdatePath 0
NSplitSize 1
NStore 1
NSRCG 0
NneuronGeneral 40
RndSeed 12395
13 changes: 13 additions & 0 deletions test/python/data/GeneralRBM_cmp/namelist.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ModPara modpara.def
LocSpin locspn.def
Trans trans.def
CoulombIntra coulombintra.def
OneBodyG greenone.def
TwoBodyG greentwo.def
Gutzwiller gutzwilleridx.def
Jastrow jastrowidx.def
Orbital orbitalidx.def
TransSym qptransidx.def
GeneralRBM_HiddenLayer rbm_hlayeridx.def
GeneralRBM_PhysLayer rbm_playeridx.def
GeneralRBM_PhysHidden rbm_phidx.def
Loading

0 comments on commit 14f95a6

Please sign in to comment.