HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/sympy/tensor/tests/test_printing.py
from sympy.tensor.tensor import TensorIndexType, tensor_indices, TensorHead
from sympy import I

def test_printing_TensMul():
    R3 = TensorIndexType('R3', dim=3)
    p, q = tensor_indices("p q", R3)
    K = TensorHead("K", [R3])

    assert repr(2*K(p)) == "2*K(p)"
    assert repr(-K(p)) == "-K(p)"
    assert repr(-2*K(p)*K(q)) == "-2*K(p)*K(q)"
    assert repr(-I*K(p)) == "-I*K(p)"
    assert repr(I*K(p)) == "I*K(p)"