summaryrefslogtreecommitdiff
path: root/Qwen2.5-Eval/evaluation/latex2sympy/tests/complex_test.py
blob: 21971418455010b422826501ac1bcb1d4197748e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from .context import assert_equal
import pytest
from sympy import Sum, I, Symbol, Integer

a = Symbol('a', real=True)
b = Symbol('b', real=True)
i = Symbol('i', real=True)
n = Symbol('n', real=True)
x = Symbol('x', real=True)


def test_complex():
    assert_equal("a+Ib", a + I * b)


def test_complex_e():
    assert_equal("e^{I\\pi}", Integer(-1))


def test_complex_sum():
    assert_equal("\\sum_{i=0}^{n} i \\cdot x", Sum(i * x, (i, 0, n)))