Skip to content

Split netket into Python and C++ parts

Vicentini Filippo requested to merge github/fork/twesterhout/split_netket into master

Created by: twesterhout

At some point (actually, pretty soon) we'll probably have some high-lever functionality which is simpler to implement in Python than in C++. Not simple enough though to require every user to re-implement it themselves.

It is then nice to convert NetKet into a "proper" Python package (i.e. with __init__.py files) and use the C++ extension just as an implementation detail. This PR achieves that. C++ code is compiled into _C_netket module which is loaded by __init__.py.

There's a bunch of one-line-long files in netket directory. The mirror the module structure of our C++ code in Python. This means that stuff like from netket.layer import DenseLayer, LogCosh still works. If someone knows a cooler way to achieve, I'm open to suggestions. But for now, that's the best I could come up with.

P.S.: Formatting changes in setup.py are made by Black. It looks like #190 didn't reformat setup.py properly.

Merge request reports