Skip to content

Commit

Permalink
Use only new-style symbols()
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpap authored and rlamy committed Apr 21, 2011
1 parent a0d2336 commit 79d41d0
Show file tree
Hide file tree
Showing 94 changed files with 434 additions and 433 deletions.
8 changes: 4 additions & 4 deletions bin/isympy
Expand Up @@ -8,8 +8,8 @@
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols("x y z t")
>>> k, m, n = symbols("k m n", integer=True)
>>> x, y, z, t = symbols("x,y,z,t")
>>> k, m, n = symbols("k,m,n", integer=True)
>>> f, g, h = map(Function, 'fgh')
So starting 'isympy' is equivalent to starting Python (or IPython)
Expand Down Expand Up @@ -64,8 +64,8 @@ long_message = """\
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> x, y, z, t = symbols('x,y,z,t')
>>> k, m, n = symbols('k,m,n', integer=True)
>>> f, g, h = map(Function, 'fgh')
Documentation can be found at http://sympy.org/
Expand Down
4 changes: 2 additions & 2 deletions data/TeXmacs/bin/tm_sympy
Expand Up @@ -57,8 +57,8 @@ from sympy import *
_ = None
x, y, z, t = symbols('xyzt')
k, i, m, n = symbols('kimn', integer=True)
x, y, z, t = symbols('x,y,z,t')
k, i, m, n = symbols('k,i,m,n', integer=True)
f = Function('f')
Expand Down
6 changes: 3 additions & 3 deletions doc/man/isympy.xml
Expand Up @@ -128,8 +128,8 @@ this will generate isympy.1 in the current directory. -->
<programlisting>
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols("xyz")
>>> k, m, n = symbols("kmn", integer=True)
>>> x, y, z = symbols("x,y,z")
>>> k, m, n = symbols("k,m,n", integer=True)
</programlisting>

<para>So starting isympy is equivalent to starting python (or ipython) and
Expand Down Expand Up @@ -169,7 +169,7 @@ this will generate isympy.1 in the current directory. -->
</varlistentry>
</variablelist>
</refsect1>

<refsect1 id="bugs">
<!-- Or use this section to tell about upstream BTS. -->
<title>BUGS</title>
Expand Down
4 changes: 2 additions & 2 deletions doc/src/gotchas.txt
Expand Up @@ -190,8 +190,8 @@ giving you some default Symbols and Functions.

>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> x, y, z, t = symbols('x,y,z,t')
>>> k, m, n = symbols('k,m,n', integer=True)
>>> f, g, h = map(Function, 'fgh')

You can also import common symbol names from :mod:`sympy.abc`.
Expand Down
12 changes: 6 additions & 6 deletions doc/src/modules/assumptions.txt
Expand Up @@ -67,7 +67,7 @@ commutative except otherwise stated.
Examples::

>>> from sympy import *
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> ask(x, Q.commutative)
True
>>> ask(x, Q.commutative, Assume(x, Q.commutative, False))
Expand All @@ -88,7 +88,7 @@ Examples::
True
>>> ask(I, Q.complex)
True
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> ask(x+I*y, Q.complex, Assume(x, Q.real) & Assume(y, Q.real))
True

Expand Down Expand Up @@ -152,7 +152,7 @@ Examples::
>>> from sympy import *
>>> ask(1/oo, Q.infinitesimal)
True
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> ask(2*x, Q.infinitesimal, Assume(x, Q.infinitesimal))
True
>>> ask(x*y, Q.infinitesimal, Assume(x, Q.infinitesimal) & Assume(y, Q.bounded))
Expand Down Expand Up @@ -202,7 +202,7 @@ Examples::
>>> from sympy import *
>>> ask(Rational(3, 4), Q.rational)
True
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> ask(x/2, Q.rational, Assume(x, Q.integer))
True
>>> ask(x/y, Q.rational, Assume(x, Q.integer) & Assume(y, Q.integer))
Expand All @@ -226,7 +226,7 @@ Examples::
Remarks
^^^^^^^
negative numbers are defined as real numbers that are not zero nor positive, so
complex numbers (with nontrivial imaginary coefficients) will return False
complex numbers (with nontrivial imaginary coefficients) will return False
in this ask. The same applies to ask positive.


Expand Down Expand Up @@ -273,7 +273,7 @@ Examples::
>>> from sympy import *
>>> ask(sqrt(2), Q.real)
True
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> ask(x*y, Q.real, Assume(x, Q.real) & Assume(y, Q.real))
True

Expand Down
2 changes: 1 addition & 1 deletion doc/src/modules/concrete.txt
Expand Up @@ -14,7 +14,7 @@ which is available in Basic class. Here is simple example involving a
polynomial:

>>> from sympy import *
>>> n, k = symbols('nk')
>>> n, k = symbols('n,k')
>>> (n**2 + 1).is_hypergeometric(n)
True

Expand Down
4 changes: 2 additions & 2 deletions doc/src/modules/logic.txt
Expand Up @@ -16,15 +16,15 @@ You can build boolean expressions with the standard python operators & (And),
|(Or), ~ (Not):

>>> from sympy import *
>>> x, y = symbols('x y')
>>> x, y = symbols('x,y')
>>> y | (x & y)
Or(And(x, y), y)
>>> x | y
Or(x, y)
>>> ~x
Not(x)

You can also form implications with >>, <<, and class Equivalent, which are
You can also form implications with >>, <<, and class Equivalent, which are
compiled away into their logical equivalents:

>>> x >> y
Expand Down
4 changes: 2 additions & 2 deletions doc/src/modules/polynomials.txt
Expand Up @@ -10,7 +10,7 @@ This tutorial tries to give an overview of the functionality concerning
polynomials within SymPy. All code examples assume::

>>> from sympy import *
>>> x, y, z = symbols('xyz')
>>> x, y, z = symbols('x,y,z')

Basic functionality
-------------------
Expand Down Expand Up @@ -88,7 +88,7 @@ In the last examples, all of the three variables x, y and z are assumed to be
variables of the polynomials. But if you have some unrelated constant as
coefficient, you can specify the variables explicitly::

>>> a, b, c = symbols('abc')
>>> a, b, c = symbols('a,b,c')
>>> f = a*x**2 + b*x + c
>>> g = 3*x + 2
>>> q, r = div(f, g, domain='QQ')
Expand Down
2 changes: 1 addition & 1 deletion doc/src/modules/rewriting.txt
Expand Up @@ -19,7 +19,7 @@ expand rules.

Expanding of arithmetic expressions involving products and powers:
>>> from sympy import *
>>> x, y, z = symbols('xyz')
>>> x, y, z = symbols('x,y,z')
>>> ((x + y)*(x - y)).expand(basic=True)
x**2 - y**2
>>> ((x + y + z)**2).expand(basic=True)
Expand Down
32 changes: 16 additions & 16 deletions doc/src/tutorial.txt
Expand Up @@ -99,8 +99,8 @@ defined the symbols x, y, z and some other things:
Python 2.4.4 console for SymPy 0.5.12-hg. These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z = symbols('xyz')
>>> k, m, n = symbols('kmn', integer=True)
>>> x, y, z = symbols('x,y,z')
>>> k, m, n = symbols('k,m,n', integer=True)
>>> f = Function("f")

Documentation can be found at http://sympy.org/
Expand Down Expand Up @@ -377,7 +377,7 @@ powerful extended Risch-Norman algorithm and some heuristics and pattern
matching::

>>> from sympy import *
>>> x, y = symbols('xy')
>>> x, y = symbols('x,y')

You can integrate elementary functions::

Expand Down Expand Up @@ -738,12 +738,12 @@ This is a nice ascii-art printing produced by a ``pprint`` function:
-
x
>>> pprint(Integral(x**2, x))
/
|
| 2
/
|
| 2
| x dx
|
/
|
/


See also the wiki `Pretty Printing
Expand All @@ -753,7 +753,7 @@ unicode printing.
Tip: To make the pretty printing default in the python interpreter, use::

$ python
Python 2.5.2 (r252:60911, Jun 25 2008, 17:58:32)
Python 2.5.2 (r252:60911, Jun 25 2008, 17:58:32)
[GCC 4.3.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
Expand All @@ -763,16 +763,16 @@ Tip: To make the pretty printing default in the python interpreter, use::
x
>>> x**3/3
3
x
x
--
3
3
>>> Integral(x**2, x) #doctest: +NORMALIZE_WHITESPACE
/
|
| 2
/
|
| 2
| x dx
|
/
|
/


**Python printing**
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/fem.py
Expand Up @@ -15,14 +15,14 @@
from sympy import symbols, Symbol, factorial, Rational, zeros, div, eye, \
integrate, diff, pprint, reduced

x, y, z = symbols('x y z')
x, y, z = symbols('x,y,z')

class ReferenceSimplex:
def __init__(self, nsd):
self.nsd = nsd
coords = []
if nsd <= 3:
coords = symbols('xyz')[:nsd]
coords = symbols('x,y,z')[:nsd]
else:
coords = []
for d in range(0,nsd):
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/plotting.py
Expand Up @@ -16,7 +16,7 @@
from time import sleep, clock

def main():
x,y,z = symbols('xyz')
x,y,z = symbols('x,y,z')

# toggle axes visibility with F5, colors with F6
axes_options = 'visible=false; colored=true; label_ticks=true; label_axes=true; overlay=true; stride=0.5'
Expand Down
10 changes: 5 additions & 5 deletions examples/intermediate/coupled_cluster.py
Expand Up @@ -28,8 +28,8 @@ def get_CC_operators():
a = symbols('a',above_fermi=True,dummy=True)
t_ai = AntiSymmetricTensor('t',(a,),(i,))
ai = NO(Fd(a)*F(i))
i,j = symbols('ij',below_fermi=True,dummy=True)
a,b = symbols('ab',above_fermi=True,dummy=True)
i,j = symbols('i,j',below_fermi=True,dummy=True)
a,b = symbols('a,b',above_fermi=True,dummy=True)
t_abij = AntiSymmetricTensor('t',(a,b),(i,j))
abji = NO(Fd(a)*Fd(b)*F(j)*F(i))

Expand All @@ -46,7 +46,7 @@ def main():
print

# setup hamiltonian
p,q,r,s = symbols('pqrs',dummy=True)
p,q,r,s = symbols('p,q,r,s',dummy=True)
f = AntiSymmetricTensor('f',(p,),(q,))
pr = NO((Fd(p)*F(q)))
v = AntiSymmetricTensor('v',(p,q),(r,s))
Expand Down Expand Up @@ -96,8 +96,8 @@ def main():
print

print "extracting CC equations from full Hbar"
i,j,k,l = symbols('ijkl',below_fermi=True)
a,b,c,d = symbols('abcd',above_fermi=True)
i,j,k,l = symbols('i,j,k,l',below_fermi=True)
a,b,c,d = symbols('a,b,c,d',above_fermi=True)
print
print "CC Energy:"
print latex(wicks(eq, simplify_dummies=True,
Expand Down
4 changes: 2 additions & 2 deletions examples/intermediate/partial_differential_eqs.py
Expand Up @@ -8,10 +8,10 @@
from sympy import Derivative as D

def main():
r, phi, theta = symbols("r phi theta")
r, phi, theta = symbols("r,phi,theta")
Xi = Function('Xi')
R, Phi, Theta, u = map(Function, ['R', 'Phi', 'Theta', 'u'])
C1, C2 = symbols('C1 C2')
C1, C2 = symbols('C1,C2')

pprint ("Separation of variables in Laplace equation in spherical coordinates")
pprint ("Laplace equation in spherical coordinates:")
Expand Down
2 changes: 1 addition & 1 deletion examples/intermediate/vandermonde.py
Expand Up @@ -131,7 +131,7 @@ def main():

print '-'*79
print "Polynomial fitting with a Vandermonde Matrix:"
x,y,z = symbols('x y z')
x,y,z = symbols('x,y,z')

points = [(0,3), (1,2), (2,3)]
print """
Expand Down
6 changes: 3 additions & 3 deletions sympy/assumptions/tests/test_assumptions_2.py
Expand Up @@ -40,8 +40,8 @@ def test_pretty():
assert pretty(Assume(x, 'positive')) == "Assume(x, 'positive')"

def test_eliminate_assumptions():
a, b = map(Predicate, symbols('ab'))
x, y = symbols('xy')
a, b = map(Predicate, symbols('a,b'))
x, y = symbols('x,y')
assert eliminate_assume(Assume(x, a)) == a
assert eliminate_assume(Assume(x, a), symbol=x) == a
assert eliminate_assume(Assume(x, a), symbol=y) == None
Expand All @@ -52,7 +52,7 @@ def test_eliminate_assumptions():

def test_global():
"""Test for global assumptions"""
x, y = symbols('x y')
x, y = symbols('x,y')
global_assumptions.add(Assume(x>0))
assert Assume(x>0) in global_assumptions
global_assumptions.remove(Assume(x>0))
Expand Down

0 comments on commit 79d41d0

Please sign in to comment.