Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Example that fail unicode #1

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

Merged
merged 2 commits into from
Mar 15, 2016
Merged
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install:
if [ "$PYTHON_VERSION" == "2.7" ]; then
conda install --yes --quiet mayavi;
conda upgrade --yes --all;
conda upgrade --yes pyface;
pip install --upgrade pyface;
fi;
fi;
- pip install -r requirements.txt
Expand Down
52 changes: 52 additions & 0 deletions examples/plot_quantum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
r"""
======================
Some Quantum Mechanics
======================

We start with a two spin system :math:`\uparrow` and :math:`\downarrow`

"""
# Author: Óscar Nájera

from __future__ import division, absolute_import, print_function


def hamiltonian(M, mu):
r"""Generate a single orbital isolated atom Hamiltonian in particle-hole
symmetry. Include chemical potential for grand Canonical calculations

.. math::
\mathcal{H} - \mu N = M(n_\uparrow - n_\downarrow)
- \mu(n_\uparrow + n_\downarrow)
"""
pass

###############################################################################
# Double occupation
# -----------------
#
# To find out the double occupation one uses the relation
# (Works in Sphinx-Gallery)

import matplotlib.pylab as plt
import numpy as np
x = np.linspace(0, 1, 20)
plt.plot(x, (1 - x**2) / 4)
plt.ylabel('$\\langle n_\\uparrow n_\\downarrow \\rangle$')
plt.show()

###############################################################################
#
# .. math:: \langle n_\uparrow n_\downarrow \rangle = \frac{2\langle V \rangle}{U}+\frac{1}{4}

print('pass')

###############################################################################
# (Does not work in Sphinx-Gallery)
# ---------------------------------

plt.plot(x, (1 - x) / 4)
plt.ylabel(r'$\langle n_\uparrow n_\downarrow \rangle$')
plt.xlabel('U')
plt.show()