Comments (1)
Hi @artemborin, the easiest is to extend the standard Json Python library:
def encode_complex(z):
if isinstance(z, complex):
return (z.real, z.imag)
else:
type_name = z.__class__.__name__
raise TypeError(
f"Object of type '{type_name}' is not JSON serializable")
and then dump with
json_file = "input.json"
with open(json_file, 'w') as outfile:
json.dump(pars, outfile, default=encode_complex)
from netket.
Related Issues (20)
- Issue on page /api/_generated/samplers/netket.experimental.sampler.MetropolisExchangePt.html
- [FR] Euclidian distance between nodes in `nk.graph.lattice` HOT 3
- Document the `mpi.n_nodes` rescaling factor in gradient computation with `nk.jax.expect` HOT 19
- MinSR regularisation HOT 8
- `vs.sample(n_samples=X, chain_length=Y)` does not error and silently ignores one argument
- vmap for modules HOT 3
- Sharding errors in sampler when using `reset_chains` in multi-node setting HOT 5
- Bug in hilbert space indexing with MPI HOT 4
- Adaptive time step fails if t0 is an integer HOT 2
- Conjugation of fermionic operators is wrong HOT 2
- Examples of observables/density operator for netket.experimental.TDVP
- TDVP not implemented for Squared LocalLiouvillian operators HOT 4
- Issue with shapes when using parallel tempering sampler on MPI HOT 6
- Generalized Hartree fock HOT 4
- TDVP convergence issues in multi-process execution HOT 4
- `operator.spin.sigmax` interplay with fermionic spaces
- LocalOperatorJax tracer leak (MetropolisHamiltonianJax breaks) HOT 1
- Changing default `n_chains` on GPUs and `n_discard_per_chain` to something more reasonable HOT 4
- Bug in MinSR code HOT 1
- Updating the installation documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netket.