scikit-hep / vector

Vector classes and utilities
https://vector.readthedocs.io
BSD 3-Clause "New" or "Revised" License
77 stars 24 forks source link

`vec.to_xyztau.t` returns `t` with incorrect sign #455

Closed Saransh-cpp closed 4 months ago

Saransh-cpp commented 4 months ago

Vector Version

main

Python Version

3.11

OS / Environment

MacOS 14.4.1

Describe the bug

In [1]: import vector

In [2]: v = vector.obj(x=3, y=2, z=1, t=-10)

In [3]: v.to_xyztau().t
Out[3]: 10.0

I am not sure if this is the intended behavior or a bug. If it is a bug, every function returning a sqrt here should be wrapped with lib.copysign (will take it up) -

https://github.com/scikit-hep/vector/blob/731dd4f803c9391ee1aa7d3b97fbcb1961977edc/src/vector/_compute/lorentz/t.py#L36-L81

cc: @jpivarski

Any additional but relevant log output

No response

Saransh-cpp commented 4 months ago

False alarm, sorry! I think this is the intended behavior. I bumped into this because some sympy tests were failing, but the failure was because of another reason.