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

Dependencies and SyntaxWarnings #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions braketlab/animate.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def setup_plot(self):

c1,c2,c3 = colorscheme().getcol(np.random.uniform(0,1,3))

self.bubbles = self.ax.plot(x, p, "-", color = (0,0,0), markersize = 1, label = "$\\vert \Psi \\vert^2$")[0]
self.bubbles = self.ax.plot(x, p, "-", color = (0,0,0), markersize = 1, label = r"$\\vert \Psi \\vert^2$")[0]

self.wf_imag = self.ax.plot(x, w.imag, "-", color = c1**.5, markersize = 1, label = "Im($\Psi$)")[0]
self.wf_real = self.ax.plot(x, w.real, "-", color = c2**.5, markersize = 1, label = "Re($\Psi$)")[0]
self.wf_imag = self.ax.plot(x, w.imag, "-", color = c1**.5, markersize = 1, label = r"Im($\Psi$)")[0]
self.wf_real = self.ax.plot(x, w.real, "-", color = c2**.5, markersize = 1, label = r"Re($\Psi$)")[0]

self.ax.legend()

Expand Down Expand Up @@ -117,4 +117,4 @@ def advance(self):

def run(self,n_steps_per_vis=1, interval = 10):
run_system = animated_system(system = self, n_steps_per_vis=n_steps_per_vis, interval = interval)
plt.show()
plt.show()
20 changes: 10 additions & 10 deletions braketlab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def construct_basis(p):


class basisfunction:
"""
r"""
# A general class for a basis function in $\mathbb{R}^n$

## Keyword arguments:
Expand Down Expand Up @@ -400,9 +400,9 @@ class basisfunction:
position = None
normalization = 1
domain = None
__name__ = "\chi"
__name__ = r"\chi"

def __init__(self, sympy_expression, position=None, domain=None, name="\chi"):
def __init__(self, sympy_expression, position=None, domain=None, name=r"\chi"):
self.__name__ = name
self.dimension = len(sympy_expression.free_symbols)

Expand Down Expand Up @@ -440,7 +440,7 @@ def __init__(self, sympy_expression, position=None, domain=None, name="\chi"):
self.decay = 1.0

def normalize(self, domain=None):
"""
r"""
Set normalization factor $N$ of self ($\chi$) so that $\langle \chi \\vert \chi \\rangle = 1$.
"""
s_12 = inner_product(self, self)
Expand Down Expand Up @@ -483,7 +483,7 @@ def get_domain(self, other=None):
return domain

def __call__(self, *r):
"""
r"""
Evaluate function in coordinates ```*r``` (arbitrary dimensions).

## Returns
Expand All @@ -494,7 +494,7 @@ def __call__(self, *r):
return self.normalization * self.ket_numeric_expression(*r)

def __mul__(self, other):
"""
r"""
Returns a basisfunction $\chi_{a*b}(\mathbf{r})$, where
$\chi_{a*b}(\mathbf{r}) = \chi_a(\mathbf{r}) \chi_b(\mathbf{r})$
"""
Expand All @@ -514,7 +514,7 @@ def __rmul__(self, other):
)

def __add__(self, other):
"""
r"""
Returns a basisfunction $\chi_{a+b}(\mathbf{r})$, where
$\chi_{a+b}(\mathbf{r}) = \chi_a(\mathbf{r}) + \chi_b(\mathbf{r})$
"""
Expand All @@ -525,7 +525,7 @@ def __add__(self, other):
)

def __sub__(self, other):
"""
r"""
Returns a basisfunction $\chi_{a-b}(\mathbf{r})$, where
$\chi_{a-b}(\mathbf{r}) = \chi_a(\mathbf{r}) - \chi_b(\mathbf{r})$
"""
Expand Down Expand Up @@ -617,7 +617,7 @@ def flatten(self):
return operator_expression(new_ops, new_coeffs)

def apply(self, other_ket):
"""
r"""
# Apply operator to ket

$\hat{\Omega} \vert a \rangle = \vert a' \rangle $
Expand Down Expand Up @@ -965,7 +965,7 @@ def get_standard_basis(n):


class ket(object):
"""
r"""
A class for vectors defined on general vector spaces
Author: Audun Skau Hansen ([email protected])

Expand Down
40 changes: 24 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@


setuptools.setup(
name='BraketLab',
version='1.8.0',
author="Audun Skau Hansen",
author_email="[email protected]",
description="Educational tool for learning quantum theory with Jupyter Notebooks",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.uio.no/audunsh/braketlab",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires = ["sympy", "numba", "evince", "bubblebox"],
)
name='BraketLab',
version='1.8.0',
author="Audun Skau Hansen",
author_email="[email protected]",
description="Educational tool for learning quantum theory with Jupyter Notebooks",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.uio.no/audunsh/braketlab",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires = [
"sympy",
"numba",
"numpy",
"matplotlib",
"scipy",
"evince",
"bubblebox"
],
)