• Stars
    star
    247
  • Rank 163,166 (Top 4 %)
  • Language
    Julia
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A differential eDSL that can run faster than light and go back to the past.

NiLang.jl (้€†lang), is a reversible domain-specific language (DSL) that allow a program to go back to the past.

  • Requires Julia version >= 1.3,

NiLang features:

  • any program written in NiLang is differentiable,
  • a reversible language with abstraction and arrays,
  • complex values
  • reversible logarithmic number system

CI codecov

The main docs can be found here:

There are also some Pluto-based notebooks:

The strangeness of reversible computing is mainly due to our lack of experience with it.โ€”Henry Baker, 1992

To Start

pkg> add NiLang

An example: Compute the norm of a vector

julia> using NiLang

julia> @i function f(res, y, x)
           for i=1:length(x)
               y += x[i] ^ 2
           end
           res += sqrt(y)
       end

julia> res_out, y_out, x_out = f(0.0, 0.0, [1, 2, 3.0])
(3.7416573867739413, 14.0, [1.0, 2.0, 3.0])

julia> (~f)(res_out, y_out, x_out)  # automatically generated inverse program.
(0.0, 0.0, [1.0, 2.0, 3.0])
        
julia> โˆ‚res, โˆ‚y, โˆ‚x = NiLang.AD.gradient(Val(1), f, (0.0, 0.0, [1, 2, 3.0])) 
    # automatic differentiation, `Val(1)` means the first argument of `f` is the loss.
(1.0, 0.1336306209562122, [0.2672612419124244, 0.5345224838248488, 0.8017837257372732])

The performance of reversible programming automatic differentiation is much better than most traditional frameworks. Here is why, and how it works,

how it works

Check our paper

@misc{Liu2020,
    title={Differentiate Everything with a Reversible Programming Language},
    author={Jin-Guo Liu and Taine Zhao},
    year={2020},
    eprint={2003.04617},
    archivePrefix={arXiv},
    primaryClass={cs.PL}
}

More Repositories

1

marburg

physics meets neural networks
Jupyter Notebook
94
star
2

viznet

network visualization toolkit
Python
51
star
3

QuantumCircuitBornMachine

gradient based training of Quantum Circuit Born Machine
Jupyter Notebook
43
star
4

ModernScientificComputing

Course AMAT5315: Advanced scientific computing, the website and Julia notebooks
Jupyter Notebook
36
star
5

BackwardsLinalg.jl

Auto differentiation over linear algebras (a Zygote extension)
Julia
30
star
6

QuantumMPS

Variational Quantum Eigensolver with Fewer Qubits
Julia
25
star
7

ScientificComputingDemos

Demos for book: Scientific computing for physicists.
Julia
22
star
8

QuantumPEPS.jl

projected entangled pair of states (PEPS), the quantum version
Julia
22
star
9

QAOA

A Quantum Approximate Optimization Algorithm
Python
16
star
10

WuLiXueBao

WuLiXueBao magazine article - automatic differentiation.
TeX
15
star
11

YaoTutorial

A tutorial for Yao.jl
Julia
12
star
12

ScientificComputingForPhysicists

A scientific computing book for physicists, with Julia programming language
Makefile
12
star
13

EliminateGraphs.jl

Graph data structure for fast elimination
Julia
12
star
14

LuxorGraphPlot.jl

A minimum Luxor backended graph visualization package.
Julia
11
star
15

nilangpaper

The paper for reversible differential programming
TeX
10
star
16

Viznet.jl

Network visualization, tensor network, lattice et. al.
Julia
9
star
17

NiLangCore.jl

Core package for time reversible language NiLang.jl
Julia
9
star
18

TreeverseAlgorithm.jl

Treeverse algorithm for optimal checkpointing
Julia
9
star
19

dmrg

Density matrix renormalization group implementation.
Python
8
star
20

AsciinemaGenerator.jl

Generate asciinema `.cast` file from a Julia script
Julia
8
star
21

MISAlgorithms.jl

Maximum independent set algorithms.
Julia
7
star
22

Jacobi_Davidson

The Jacobi Davison diagonalization, python interface with fortran underlying.
Python
7
star
23

ProblemReductions.jl

Reduction between computational hard problems.
Julia
6
star
24

metaprog_turtorial

A tutorial on meta programming - materials for the group meeting
Jupyter Notebook
6
star
25

nrg_mapping

mapping cheme for arbituary hybridization function.
Python
6
star
26

nrg

Numerical renormalization group
Python
6
star
27

NoteOnTropicalMIS

paper and code
TeX
5
star
28

TikzGenerator.jl

Tikz graph generator.
Julia
5
star
29

tensors_tutorial_jizhi

A intruductory material for tensors (้›†ๆ™บ talk)
HTML
4
star
30

happy-binaries-website

Jinguo Liu Group Website - we are happy binaries.
CSS
4
star
31

pymps

Matrix Product State in Python
Python
4
star
32

ITensorContractionOrders.jl

ITensors + OMEinsumContractionOrders for large scale random tensor network contraction
Julia
4
star
33

dynamicQPF

dynamical quantum phase transition, Yao, ProjectQ and QtVM realizations.
Jupyter Notebook
4
star
34

lecture-hard-core-lattice-gases

Lecture notebooks.
Julia
3
star
35

FactorGraph.jl

factor graph modeling and variable elimination
Julia
3
star
36

QuRBM

Restricted Boltzmann Machine for Quantum lattice.
Python
2
star
37

WebGTN.jl

Generic tensor network's Web API
JavaScript
2
star
38

poorman_nn

Poorman's neural network
Python
2
star
39

squid

superconducting quantum interference device
Python
1
star
40

notebooks

pluto notebooks (some disorganized mess)
HTML
1
star
41

bes

Bulk Entanglement Spectrum, the demo of PRL 113, 106801.
Python
1
star
42

GiggleLiu

1
star
43

mbl

many body localization studies.
Python
1
star
44

chemical-lab

Python
1
star
45

numericclub

JavaScript
1
star