diff --git a/.travis.yml b/.travis.yml index 59ca464fe..943cfde58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/examples/plot_quantum.py b/examples/plot_quantum.py new file mode 100644 index 000000000..0b4609be5 --- /dev/null +++ b/examples/plot_quantum.py @@ -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()