Skip to content

Commit

Permalink
Create pubs/FreemanEtAl23_PNAS
Browse files Browse the repository at this point in the history
  • Loading branch information
dg227 committed Jan 20, 2023
1 parent 141ea50 commit 57f02cf
Show file tree
Hide file tree
Showing 37 changed files with 9,673 additions and 1,786 deletions.
283 changes: 150 additions & 133 deletions Python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,133 +1,150 @@
anyio==3.6.1
appnope==0.1.3
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
astor==0.8.1
asttokens==2.0.8
attrs==22.1.0
Babel==2.10.3
backcall==0.2.0
beautifulsoup4==4.11.1
bleach==5.0.1
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
contourpy==1.0.5
coverage==6.5.0
cryptography==38.0.3
cycler==0.11.0
debugpy==1.6.3
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.5.1
entrypoints==0.4
executing==1.1.1
fastjsonschema==2.16.2
flake8==5.0.4
fonttools==4.37.4
idna==3.4
iniconfig==1.1.1
ipykernel==6.16.0
ipympl==0.9.2
ipython==8.5.0
ipython-genutils==0.2.0
ipywidgets==8.0.2
jedi==0.18.1
Jinja2==3.1.2
json5==0.9.10
jsonschema==4.16.0
jupyter-core==4.11.1
jupyter-server==1.21.0
jupyter_client==7.4.2
jupyterlab==3.4.8
jupyterlab-pygments==0.2.2
jupyterlab-spellchecker==0.7.2
jupyterlab-vim==0.15.1
jupyterlab-widgets==3.0.3
jupyterlab_server==2.16.0
kiwisolver==1.4.4
llvmlite==0.39.1
lxml==4.9.1
MarkupSafe==2.1.1
matplotlib==3.6.1
matplotlib-inline==0.1.6
mccabe==0.7.0
mistune==2.0.4
more-itertools==8.14.0
mpmath==1.2.1
multiprocess==0.70.13
mypy==0.982
mypy-extensions==0.4.3
nb-mypy==1.0.4
nbclassic==0.4.5
nbclient==0.7.0
nbconvert==7.2.1
nbformat==5.7.0
nest-asyncio==1.5.6
-e git+https://github.com/dg227/NLSAdev@4a630361b10c287104afa4e914f78d5bab54c5da#egg=nlsa&subdirectory=Python
nodeenv==1.7.0
nodejs==0.1.1
notebook==6.5.1
notebook-shim==0.1.0
nptyping==2.3.1
ntlm-auth==1.5.0
numba==0.56.3
numpy==1.23.4
optional-django==0.1.0
packaging==21.3
pandocfilters==1.5.0
parso==0.8.3
pbr==5.11.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.2.0
pluggy==1.0.0
ply==3.11
prometheus-client==0.15.0
prompt-toolkit==3.0.31
psutil==5.9.2
ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
Pygments==2.13.0
pylatexenc==2.10
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.3
pytest-cov==4.0.0
python-dateutil==2.8.2
pytz==2022.4
pyzmq==24.0.1
qiskit==0.39.2
qiskit-aer==0.11.1
qiskit-ibmq-provider==0.19.2
qiskit-terra==0.22.2
requests==2.28.1
requests-ntlm==1.1.0
retworkx==0.12.0
rustworkx==0.12.0
scipy==1.9.2
Send2Trash==1.8.0
six==1.16.0
sniffio==1.3.0
soupsieve==2.3.2.post1
stack-data==0.5.1
stevedore==4.1.1
symengine==0.9.2
sympy==1.11.1
terminado==0.16.0
tinycss2==1.1.1
tomli==2.0.1
tornado==6.2
traitlets==5.4.0
tweedledum==1.1.1
typing_extensions==4.4.0
urllib3==1.26.12
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.4.1
websockets==10.4
widgetsnbextension==4.0.3
anyio>=3.6.2
appnope>=0.1.3
argon2-cffi>=21.3.0
argon2-cffi-bindings>=21.2.0
arrow>=1.2.3
astor>=0.8.1
asttokens>=2.2.1
attrs>=22.2.0
Babel>=2.11.0
backcall>=0.2.0
beautifulsoup4>=4.11.1
bleach>=5.0.1
certifi>=2022.12.7
cffi>=1.15.1
charset-normalizer>=2.1.1
comm>=0.1.2
contourpy>=1.0.6
coverage>=7.0.1
cryptography>=38.0.4
cycler>=0.11.0
debugpy>=1.6.4
decorator>=5.1.1
defusedxml>=0.7.1
dill>=0.3.6
entrypoints>=0.4
exceptiongroup>=1.1.0
executing>=1.2.0
fastjsonschema>=2.16.2
flake8>=6.0.0
fonttools>=4.38.0
fqdn>=1.5.1
h5py>=3.7.0
idna>=3.4
iniconfig>=1.1.1
ipykernel>=6.19.4
ipympl>=0.9.2
ipython>=8.7.0
ipython-genutils>=0.2.0
ipywidgets>=8.0.4
isoduration>=20.11.0
jedi>=0.18.2
Jinja2>=3.1.2
json5>=0.9.10
jsonpointer>=2.3
jsonschema>=4.17.3
jupyter-events>=0.5.0
jupyter_client>=7.4.8
jupyter_core>=5.1.1
jupyter_server>=2.0.6
jupyter_server_terminals>=0.4.3
jupyterlab>=3.5.2
jupyterlab-pygments>=0.2.2
jupyterlab-spellchecker>=0.7.2
jupyterlab-vim>=0.15.1
jupyterlab-widgets>=3.0.5
jupyterlab_server>=2.17.0
kiwisolver>=1.4.4
llvmlite>=0.39.1
lxml>=4.9.2
MarkupSafe>=2.1.1
mat73>=0.59
matplotlib>=3.6.2
matplotlib-inline>=0.1.6
mccabe>=0.7.0
mistune>=2.0.4
more-itertools>=9.0.0
mpmath>=1.2.1
multiprocess>=0.70.14
mypy>=0.991
mypy-extensions>=0.4.3
nb-mypy>=1.0.4
nbclassic>=0.4.8
nbclient>=0.7.2
nbconvert>=7.2.7
nbformat>=5.7.1
nest-asyncio>=1.5.6
-e git+https://github.com/dg227/NLSAdev@db378330128c79f02b763e98319d05fb1f8416b9#egg=nlsa&subdirectory=Python
nodeenv>=1.7.0
nodejs>=0.1.1
notebook>=6.5.2
notebook_shim>=0.2.2
nptyping>=2.4.1
ntlm-auth>=1.5.0
numba>=0.56.4
numpy>=1.23.5
optional-django>=0.1.0
packaging>=22.0
pandocfilters>=1.5.0
parso>=0.8.3
pbr>=5.11.0
pexpect>=4.8.0
pickleshare>=0.7.5
Pillow>=9.3.0
platformdirs>=2.6.2
pluggy>=1.0.0
ply>=3.11
prometheus-client>=0.15.0
prompt-toolkit>=3.0.36
psutil>=5.9.4
ptyprocess>=0.7.0
pure-eval>=0.2.2
py>=1.11.0
pycodestyle>=2.10.0
pycparser>=2.21
pyflakes>=3.0.1
Pygments>=2.13.0
pylatexenc>=2.10
pyparsing>=3.0.9
pyrsistent>=0.19.3
pytest>=7.2.0
pytest-cov>=4.0.0
python-dateutil>=2.8.2
python-json-logger>=2.0.4
pytz>=2022.7
PyYAML>=6.0
pyzmq>=24.0.1
qiskit>=0.39.4
qiskit-aer>=0.11.2
qiskit-ibmq-provider>=0.19.2
qiskit-terra>=0.22.3
requests>=2.28.1
requests-ntlm>=1.1.0
retworkx>=0.12.1
rfc3339-validator>=0.1.4
rfc3986-validator>=0.1.1
rustworkx>=0.12.1
scipy>=1.9.3
Send2Trash>=1.8.0
six>=1.16.0
sniffio>=1.3.0
soupsieve>=2.3.2.post1
stack-data>=0.6.2
stevedore>=4.1.1
symengine>=0.9.2
sympy>=1.11.1
terminado>=0.17.1
tinycss2>=1.2.1
tomli>=2.0.1
tornado>=6.2
traitlets>=5.8.0
tweedledum>=1.1.1
typing_extensions>=4.4.0
uri-template>=1.2.0
urllib3>=1.26.13
wcwidth>=0.2.5
webcolors>=1.12
webencodings>=0.5.1
websocket-client>=1.4.2
websockets>=10.4
widgetsnbextension>=4.0.5
6 changes: 3 additions & 3 deletions Python/src/nlsa/abstract_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from functools import partial
from itertools import accumulate, repeat
from typing import Callable, Iterator, Optional, Protocol, TypeVar, \
runtime_checkable, Generic
runtime_checkable

B = TypeVar('B')
B_contra = TypeVar('B_contra', contravariant=True)
Expand Down Expand Up @@ -52,7 +52,7 @@ def __getitem__(self, key: int) -> T_co:
...


class SupportsAdd(Protocol[T]):
class SupportsAdd(Protocol):
"""Represents types supporting addition."""
def __add__(a: T, b: T) -> T:
...
Expand Down Expand Up @@ -333,7 +333,7 @@ def make_l2_innerp(impl: ImplementsStarAlgebra[T], mu: Callable[[T], S])\
return ip


def riesz_dual(w: Callable[[U, T], S], u: U) -> Callable[[T], S]:
def riesz_dual(w: Callable[[U, U], S], u: U) -> Callable[[U], S]:
"""Riesz dual vector associated with bilinear form.
:w: Bilinear form
Expand Down
8 changes: 3 additions & 5 deletions Python/src/nlsa/function_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
X2 = TypeVar('X2')
Y = TypeVar('Y')
Z = TypeVar('Z')
# A = TypeVar('A', bound=SupportsAdd)
A = TypeVar('A')
A = TypeVar('A', bound=SupportsAdd)
S = TypeVar('S', bound=SupportsSub)
K = TypeVar('K', bound=SupportsMul[object, object])
M = TypeVar('M', bound=SupportsMatmul)
Expand Down Expand Up @@ -108,10 +107,9 @@ def incl(self, f: Callable[[X_co], T_contra]) -> V_co:
...


def add(f: Callable[[X], SupportsAdd[A]], g: Callable[[X], SupportsAdd[A]])\
-> Callable[[X], SupportsAdd[A]]:
def add(f: Callable[[X], A], g: Callable[[X], A]) -> Callable[[X], A]:
"""Implements function addition."""
def h(x: X) -> SupportsAdd[A]:
def h(x: X) -> A:
y = f(x) + g(x)
return y
return h
Expand Down
10 changes: 5 additions & 5 deletions Python/src/nlsa/matrix_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ def eig_sorted(a: A, n: Optional[int] = None,
"""
wv = la.eig(a)
if which == 'LA' or 'SA' or 'LR' or 'SR':
if which in ('LA', 'SA', 'LR', 'SR'):
idx = wv[0].real.argsort()
elif which == 'LI' or 'SI':
elif which in ('LI', 'SI'):
idx = wv[0].imag.argsort()
elif which == 'LM' or 'SM':
elif which in ('LM', 'SM'):
idx = wv[0].abs.argsort()
if n is None:
n = len(a)
if which == 'LA' or 'LM' or 'LR' or 'LI':
if which in ('LA', 'LM', 'LR', 'LI'):
idx = idx[::-1]
w: W = wv[0][idx[0:n]]
v: A = wv[1][:, idx[0:n]]
Expand Down Expand Up @@ -135,7 +135,7 @@ def eigs_sorted(a: A, n: Optional[int] = None, which: WhichEigs = 'LR',
else:
wv = sla.eigs(a, n, which=which)
idx = np.arange(0, n)
if which == 'LA' or 'LM' or 'LR' or 'LI':
if which in ('LA', 'LM', 'LR', 'LI'):
idx = idx[::-1]
w: W = wv[0][idx[0:n]]
v: A = wv[1][:, idx[0:n]]
Expand Down
Loading

0 comments on commit 57f02cf

Please sign in to comment.