Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementation of a finite MPS class #234

Merged
merged 292 commits into from Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
292 commits
Select commit Hold shift + click to select a range
d5149e8
added tests
mganahl Aug 27, 2019
e8fa237
syntax error
mganahl Aug 27, 2019
d8697a0
cosmetics
mganahl Aug 27, 2019
9a0a652
added tests
mganahl Aug 27, 2019
fd4c788
added tests
mganahl Aug 27, 2019
77e3808
formatting
mganahl Aug 27, 2019
cc0a9c9
formatting
mganahl Aug 27, 2019
7c101de
Merge branch 'backend_methods' into MPSnew
mganahl Aug 27, 2019
cd4ce6d
mps.py changes
mganahl Aug 27, 2019
32cc3fe
test updated
mganahl Aug 27, 2019
66e090e
arbitrary shapes in zeros, ...
mganahl Aug 27, 2019
1fd914e
tests updated
mganahl Aug 27, 2019
7089f3e
tests updated
mganahl Aug 27, 2019
861b6de
test updated
mganahl Aug 27, 2019
be18b29
arbitrary shapes in zeros, ...
mganahl Aug 27, 2019
e4203f2
arbitrary shapes in zeros, ...
mganahl Aug 27, 2019
486b527
bugfix
mganahl Aug 27, 2019
a9859f9
formatting
mganahl Aug 27, 2019
ca29a78
Merge branch 'backend_methods' into MPSnew
mganahl Aug 27, 2019
fdc82e6
add conj
mganahl Aug 27, 2019
a296b9c
add conj
mganahl Aug 27, 2019
5cb27a7
add conj
mganahl Aug 27, 2019
9d68d60
wip
mganahl Aug 27, 2019
c4315b0
added conj
mganahl Aug 27, 2019
82a4e14
formatting
mganahl Aug 27, 2019
8272b84
Merge branch 'backend_methods' into MPSnew
mganahl Aug 27, 2019
ed9babb
return dtype added
mganahl Aug 27, 2019
11cb233
return type added
mganahl Aug 27, 2019
92353a6
return type added
mganahl Aug 27, 2019
9cffe33
return type added
mganahl Aug 27, 2019
37e7c27
conj added
mganahl Aug 27, 2019
d816995
arguments of zeros, ... changed
mganahl Aug 27, 2019
969aae5
conj added
mganahl Aug 27, 2019
bda3804
formatting
mganahl Aug 27, 2019
b22efa3
formatting
mganahl Aug 27, 2019
a0bce04
added conj test
mganahl Aug 28, 2019
a7b753c
added conj test
mganahl Aug 28, 2019
96368c7
typo
mganahl Aug 28, 2019
b177d9f
addec conj test
mganahl Aug 28, 2019
a4127a0
forgot self in conj
mganahl Aug 28, 2019
69db45e
forgot self in conj
mganahl Aug 28, 2019
8c29c7f
line breakes
mganahl Aug 28, 2019
c368fe5
pylint: disable=reimported
mganahl Aug 28, 2019
e852a5b
import tensorflow as tf
mganahl Aug 28, 2019
9a424c9
tensorflow.DType -> tf.DType
mganahl Aug 28, 2019
2b902f2
Merge branch 'backend_methods' into MPSnew
mganahl Aug 28, 2019
66f6116
Typing fixed
mganahl Aug 28, 2019
b48a330
Typing fixed
mganahl Aug 28, 2019
99751e1
ShapeType and dtype removed
mganahl Aug 28, 2019
116b34e
typo removed
mganahl Aug 28, 2019
d51f3cc
global tensorflow import
mganahl Aug 28, 2019
4ab97f6
global numpy import
mganahl Aug 28, 2019
986a411
globally import torch
mganahl Aug 28, 2019
67d30f2
use actual np.dtype
mganahl Aug 28, 2019
d2eb54e
use torch.dtype
mganahl Aug 28, 2019
bc4d3cd
added self.dtype to TensorNetwork
mganahl Aug 28, 2019
7b0cfa4
docstring
mganahl Aug 28, 2019
36b5b14
import tensorflow as tf
mganahl Aug 28, 2019
55835e8
make dtype required in initialization methods
mganahl Aug 28, 2019
7225893
make dtype required in initialization methods
mganahl Aug 28, 2019
c32bdbc
make dtype required in initialization methods
mganahl Aug 28, 2019
f2bc0ba
make dtype required in initialization methods
mganahl Aug 28, 2019
17a5ca3
make dtype required in initialization methods
mganahl Aug 28, 2019
ebd0921
remove dtype
mganahl Aug 28, 2019
21ef1b3
change argument order in eye
mganahl Aug 28, 2019
bd94c23
change argument order in eye
mganahl Aug 28, 2019
35118dd
change argument order in eye
mganahl Aug 28, 2019
0a63fd7
change argument order in eye
mganahl Aug 28, 2019
5237096
change argument order in eye
mganahl Aug 28, 2019
c91acb3
typo
mganahl Aug 28, 2019
93cbb32
added dtype as required argument to constructor
mganahl Aug 29, 2019
7de539f
added property `dtype` = backend.dtype
mganahl Aug 29, 2019
c5ecf5d
default dtypes and dict of supported dtypes added
mganahl Aug 29, 2019
9859902
added dtype to pytorch backend
mganahl Aug 29, 2019
2938929
adddd test
mganahl Aug 29, 2019
b3b0226
Optional added to __init__
mganahl Aug 29, 2019
ac6f193
typing added
mganahl Aug 29, 2019
edb148d
typo
mganahl Aug 29, 2019
d2da6ef
added dtype to shell backend
mganahl Aug 29, 2019
0f2b308
tests fixed
mganahl Aug 29, 2019
dc5594e
more tests
mganahl Aug 29, 2019
20596a0
more tests
mganahl Aug 29, 2019
58164f8
more tests
mganahl Aug 29, 2019
45d8a57
added dtype attribute and typing to initializers
mganahl Aug 29, 2019
2418789
added dtype to backend_factory
mganahl Aug 29, 2019
8e61df9
dtuype defaults and supported dtypesc
mganahl Aug 29, 2019
870514a
Merge remote-tracking branch 'upstream/master' into backend_methods
mganahl Aug 29, 2019
9c02a11
optional dtype added to switch_backend
mganahl Aug 29, 2019
1ee90eb
typo
mganahl Aug 29, 2019
e59c19e
linter linter
mganahl Aug 29, 2019
7119890
ValueError -> TypeError
mganahl Aug 29, 2019
2db841d
dtype and TODO added
mganahl Aug 29, 2019
76c90ba
raise TypeError of dtypes mismatch
mganahl Aug 29, 2019
187f2f8
added np.float16 to jax dtypes
mganahl Aug 29, 2019
c10b655
raise ValueError if backend is not supportee
mganahl Aug 29, 2019
37c335b
tests fixed
mganahl Aug 29, 2019
e3f7b2c
linter
mganahl Aug 29, 2019
a62875f
raise ValueERror if dtypes dont' match
mganahl Aug 29, 2019
025eac5
tuypo
mganahl Aug 29, 2019
ce1ff16
bug in merge_nmetworks fixed
mganahl Aug 29, 2019
7098a8e
docstring
mganahl Aug 29, 2019
19d05a4
default dtype change to None
mganahl Aug 29, 2019
d6cd192
default dtupe changed to None
mganahl Aug 29, 2019
930d398
default backend changed to None
mganahl Aug 29, 2019
093d7e8
default backend changed to None
mganahl Aug 29, 2019
dd323ca
typo fixed
mganahl Aug 29, 2019
db20e80
default dtypes are None for all backends (old behaviour)
mganahl Aug 29, 2019
daabace
nothing
mganahl Aug 29, 2019
476adbe
no change
mganahl Aug 29, 2019
a6440a8
Tuple[int] -> Sequence[int]
mganahl Aug 29, 2019
ab7cdff
type error in ShellTensor.__init__ fixed
mganahl Aug 29, 2019
f99b4f7
Sequence[int] -> Tuple[int, ...]
mganahl Aug 29, 2019
5b5ea54
comment added
mganahl Aug 29, 2019
cca1038
added type deduction for TensorNetwork to add_node
mganahl Aug 29, 2019
bf80709
merge_network dtype derivation was wrong
mganahl Aug 29, 2019
07e805f
more types added to supported numpy dtypes
mganahl Aug 29, 2019
93f1105
jax bakend dtypes updated to be the same as numpy backend
mganahl Aug 29, 2019
ce3e156
pylint error
mganahl Aug 29, 2019
70e86ec
added dtype to ShellTensor
mganahl Aug 29, 2019
4fdbccb
typing updated for ShellTensor.reshape
mganahl Aug 29, 2019
bb978a8
Merge branch 'backend_methods' into MPSnew
mganahl Aug 29, 2019
7b55764
deprecated tf functions removed
mganahl Aug 29, 2019
de5de6a
implementation of mps.left_envs
mganahl Aug 29, 2019
cee1a82
bug fix in split_node_rq + more test added
mganahl Aug 29, 2019
15ced64
Merge branch 'master' into rq_fix
mganahl Aug 29, 2019
e8fa97d
Merge branch 'rq_fix' into MPSnew
mganahl Aug 29, 2019
eb35664
test cases cleaned up
mganahl Aug 29, 2019
eb28fd2
dtype.setter removed
mganahl Aug 29, 2019
42b62d0
better error message
mganahl Aug 29, 2019
906f662
paramtrized tests
mganahl Aug 29, 2019
5bb9312
added mps_test.py
mganahl Aug 29, 2019
8f9e5a3
remove unused variable
mganahl Aug 29, 2019
678abc3
remove tensorflow import
mganahl Aug 29, 2019
06e9360
Merge branch 'backend_methods' into MPSnew
mganahl Aug 29, 2019
37cc1a7
added right_envs + tests
mganahl Aug 30, 2019
0bfa61c
removed tensorflow import
mganahl Aug 30, 2019
46f56ba
tf.DType removed
mganahl Aug 30, 2019
a005ada
import tensorflow locally
mganahl Aug 30, 2019
82ade8b
reshaping, make floats
mganahl Aug 30, 2019
bb6f687
int to floatcc
mganahl Aug 30, 2019
d28c304
too many tf imports
mganahl Aug 30, 2019
0870c8f
Merge branch 'backend_methods' into MPSnew
mganahl Aug 30, 2019
d74abcb
changed values to int
mganahl Aug 30, 2019
b8abe66
changed values to float
mganahl Aug 30, 2019
bebfc48
backend methods testing for all dupported dtypes
mganahl Aug 30, 2019
012169d
Tuple -> Sequence
mganahl Aug 30, 2019
2b89e70
int -> float
mganahl Aug 30, 2019
683acc5
add default dtype
mganahl Aug 30, 2019
3824dbe
load default_dtype from config
mganahl Aug 30, 2019
894b2e5
more parametrization
mganahl Aug 30, 2019
09e28e4
some more ints to floats
mganahl Aug 30, 2019
a4f1e67
some more ints to floats
mganahl Aug 30, 2019
e1feb0a
default dtype
mganahl Aug 30, 2019
d3cfbe4
docstring formatting
mganahl Aug 30, 2019
98b0088
Merge branch 'backend_methods' into MPSnew
mganahl Aug 30, 2019
5bcb197
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Aug 30, 2019
e873f53
docstring
mganahl Aug 30, 2019
773ae96
Merge remote-tracking branch 'upstream/master' into rq_fix
mganahl Aug 30, 2019
00f0a6e
tests parametrized
mganahl Aug 30, 2019
0636b2e
Merge remote-tracking branch 'upstream/master' into rq_fix
mganahl Aug 30, 2019
d22ebe2
Merge branch 'rq_fix' into MPSnew
mganahl Aug 30, 2019
2785bda
reimport torch
mganahl Aug 30, 2019
a4e0554
docstrings
mganahl Sep 1, 2019
ab2db13
added correlator measurement
mganahl Sep 3, 2019
51630bf
use transfer_operator
mganahl Sep 3, 2019
6d6b043
typing added
mganahl Sep 3, 2019
0caf9f5
bugfix in pytorch backend
mganahl Sep 3, 2019
fe31e6a
pytype errors fixed
mganahl Sep 3, 2019
067bc7f
tests added
mganahl Sep 3, 2019
027b16f
tests for torch.eye modified
mganahl Sep 3, 2019
0f8975b
Merge branch 'pytorch_eye_fix' into MPSnew
mganahl Sep 3, 2019
2d7d9de
measurement tests added
mganahl Sep 3, 2019
ab2bba1
abs added
mganahl Sep 3, 2019
4efbb2f
test dtype parametrization added
mganahl Sep 3, 2019
6eb95b1
created mops folder, moved mps stuff into mps folder
mganahl Sep 3, 2019
1f34317
docstring typos + added a line
mganahl Sep 3, 2019
10a0ba6
removed some unneccessary functions
mganahl Sep 3, 2019
498c365
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 5, 2019
3d155b6
reset to upstream/master version
mganahl Sep 5, 2019
c3baa89
raise NotImplementedError in FiniteMPS.save
mganahl Sep 5, 2019
0a2ffd3
sorted right sites before using themm
mganahl Sep 5, 2019
0c811fc
renaming
mganahl Sep 5, 2019
278b057
some file moving
mganahl Sep 5, 2019
c61c7e6
set numpy seed for reproducability
mganahl Sep 5, 2019
40df3ca
transfer_operator -> apply_transfer_operator
mganahl Sep 5, 2019
2e09795
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 5, 2019
9ff824a
wrong line continuation
mganahl Sep 5, 2019
5fcc0bb
added some pylint: disable lines
mganahl Sep 5, 2019
c62efe7
fixing linter error due to mixed-line-endings warning
mganahl Sep 5, 2019
140cb02
pylint: disable=no-member added
mganahl Sep 5, 2019
55fa9d2
pylint: disable=no-member added
mganahl Sep 5, 2019
f8cb653
typo removed
mganahl Sep 5, 2019
22fd253
add mps-folder to circumvent cyclic imports
mganahl Sep 5, 2019
df7bf4e
import FiniteMPS directly
Sep 5, 2019
9051888
added missing __init__.py
mganahl Sep 5, 2019
2c2cfda
Merge branch 'MPSnew' of https://github.com/mganahl/TensorNetwork int…
Sep 5, 2019
0107fa8
some renaming to make pytype happy
mganahl Sep 5, 2019
035fb34
removed file
mganahl Sep 5, 2019
4c8bfc1
Merge remote-tracking branch 'upstream/master' into MPSnew
Sep 5, 2019
b7e9f1e
removed comment
mganahl Sep 5, 2019
a9e2965
import TensorNetwork from tensornetwork.network
mganahl Sep 5, 2019
d09c001
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 5, 2019
0d4f3e7
typo removed
Sep 6, 2019
3537273
use fixture fro testcases
Sep 6, 2019
34912c8
nodes -> property
Sep 6, 2019
e748af5
docstring changes
Sep 6, 2019
6c61525
Merge remote-tracking branch 'upstream/master' into MPSnew
Sep 6, 2019
b93dbbc
some commemnts added
mganahl Sep 7, 2019
800dfb7
typo
mganahl Sep 7, 2019
a19db8f
docstring update
mganahl Sep 7, 2019
290e5b6
Merge remote-tracking branch 'upstream/master' into MPSnew
Sep 9, 2019
844c123
bug fix
Sep 10, 2019
2c71d30
streamline code
Sep 10, 2019
bf2218c
change tuple to list
Sep 10, 2019
d65053b
tuple->list
Sep 10, 2019
0ad4292
Merge branch 'qr_bug_fix' into MPSnew
Sep 10, 2019
7d46305
remove redundant code
Sep 10, 2019
4eb2da2
avoid using node.tensor.shape in eye; use node.shape instead
Sep 10, 2019
c57a366
raise ValueError in check_orthonormality
Sep 10, 2019
51ba1d1
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 12, 2019
a0bda70
remove inheritance from TensorNetwork
mganahl Sep 12, 2019
eab4192
change mps.contract_between to mps._net.contract_between
mganahl Sep 12, 2019
3a1c722
docstring
mganahl Sep 12, 2019
fa36065
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 14, 2019
ea62894
line-confusion
mganahl Sep 14, 2019
3530cbf
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Sep 16, 2019
ecfad2d
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 3, 2019
0e9f31d
updating
mganahl Oct 3, 2019
ba77d2e
add tn.norm
mganahl Oct 4, 2019
a5d304c
import norm
mganahl Oct 4, 2019
f8adf24
allow `Node` as input to `Node.__init__`
mganahl Oct 4, 2019
00bcf1f
docstring and typing
mganahl Oct 4, 2019
9dd98d3
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 4, 2019
261dda2
fixed tests (remove TensorNetwork)
mganahl Oct 4, 2019
5fd0be0
removed TensorNetwork dependency
mganahl Oct 4, 2019
9c9566d
docstring
mganahl Oct 4, 2019
1a95312
fixed cyclic import
mganahl Oct 4, 2019
dbc2c20
linter error
mganahl Oct 4, 2019
af26bfb
fix typing
mganahl Oct 4, 2019
8d2695e
remove Range
mganahl Oct 4, 2019
666a12b
add Iterable
mganahl Oct 4, 2019
a934f5a
Iterable->Sequence
mganahl Oct 4, 2019
e163cfd
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 5, 2019
214421b
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 7, 2019
91a2261
Merge branch 'master' into MPSnew
Oct 14, 2019
edda583
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 15, 2019
ef8d822
Merge branch 'MPSnew' of https://github.com/mganahl/TensorNetwork int…
mganahl Oct 15, 2019
c79aa22
linting
mganahl Oct 15, 2019
8420225
Merge remote-tracking branch 'upstream/master' into MPSnew
mganahl Oct 15, 2019
90bf96b
fix docstring
mganahl Oct 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions conftest.py
Expand Up @@ -18,9 +18,9 @@
import tensorflow as tf


@pytest.fixture(name="backend", params=["numpy", "tensorflow",
"jax", "pytorch"])
def backend_fixure(request):
@pytest.fixture(
name="backend", params=["numpy", "tensorflow", "jax", "pytorch"])
def backend_fixture(request):
return request.param


Expand Down
4 changes: 2 additions & 2 deletions tensornetwork/__init__.py
@@ -1,8 +1,8 @@

from tensornetwork.network import TensorNetwork
from tensornetwork.network_components import Node, Edge, CopyNode, BaseNode
#pylint: disable=line-too-long
from tensornetwork.network_operations import conj, copy, transpose, split_node, split_node_qr, split_node_rq, split_node_full_svd, reachable, check_connected, check_correct, get_all_nodes, get_all_edges, remove_node, contract_trace_edges

from tensornetwork.network_operations import conj, copy, transpose, split_node, split_node_qr, split_node_rq, split_node_full_svd, reachable, check_connected, check_correct, get_all_nodes, get_all_edges, remove_node, contract_trace_edges, norm

from tensornetwork.network_components import contract, contract_copy_node, contract_between, outer_product, outer_product_final_nodes, contract_parallel, flatten_edges, get_all_nondangling, get_all_dangling, flatten_all_edges, flatten_edges_between, get_parallel_edges, get_shared_edges

Expand Down
1 change: 1 addition & 0 deletions tensornetwork/matrixproductstates/__init__.py
@@ -0,0 +1 @@
from tensornetwork.matrixproductstates import mps