Repository: scikit-hep/vector

Issue:
`q**2` is always positive for vector.MomentumObject4D
### Vector Version

1.3.1

### Python Version

3.11.4

### OS / Environment

Kubuntu 22.04
vector is installed via pip inside a conda environment

### Describe the bug

When calculating `q**2` of a 4-vector that is created from `vector.obj`, the value is always positive, even when it should not be:
```python
>>> vector.obj(E=1, px=1, py=1, pz=1)**2
2.0000000000000004
```
For numpy vector arrays, the behavior is correct and as expected:
```python
>>> vector.array({"E": [1], "px": [1], "py": [1], "pz": [1]})**2
array([-2.])
```
I have not tested other backends (e.g. awkward).

### Any additional but relevant log output

_No response_

Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/scikit-hep/vector/pull/444?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 86.38%. Comparing base [(`06a7337`)](https://app.codecov.io/gh/scikit-hep/vector/commit/06a733784d8df77d2fe4ad0f87051f725fd6a831?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep) to head [(`d03377e`)](https://app.codecov.io/gh/scikit-hep/vector/pull/444?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep).


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   86.30%   86.38%   +0.08%     
==========================================
  Files          96       96              
  Lines       11139    11139              
==========================================
+ Hits         9613     9622       +9     
+ Misses       1526     1517       -9     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/scikit-hep/vector/pull/444?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scikit-hep).


Patch:
diff --git a/src/vector/backends/object.py b/src/vector/backends/object.py
index ddc44ca..18a202b 100644
--- a/src/vector/backends/object.py
+++ b/src/vector/backends/object.py
@@ -387,7 +387,7 @@ class VectorObject(Vector):
         return _replace_data(self, numpy.true_divide(self, other))  # type: ignore[call-overload]
 
     def __pow__(self, other: float) -> float:
-        return numpy.power(self, other)  # type: ignore[call-overload]
+        return numpy.square(self) if other == 2 else numpy.power(self, other)  # type: ignore[call-overload]
 
     def __matmul__(self, other: VectorProtocol) -> float:
         return numpy.matmul(self, other)  # type: ignore[call-overload]


Test patch:
diff --git a/tests/compute/test_isclose.py b/tests/compute/test_isclose.py
index 62c9449..a101046 100644
--- a/tests/compute/test_isclose.py
+++ b/tests/compute/test_isclose.py
@@ -62,8 +62,6 @@ def test_spatial_object():
 
     for t1 in "xyz", "xytheta", "xyeta", "rhophiz", "rhophitheta", "rhophieta":
         for t2 in "xyz", "xytheta", "xyeta", "rhophiz", "rhophitheta", "rhophieta":
-            print(t1, t2)
-
             transformed1, transformed2 = (
                 getattr(v1, "to_" + t1)(),
                 getattr(v2, "to_" + t2)(),
diff --git a/tests/test_issues.py b/tests/test_issues.py
index d0be1ce..c1d509e 100644
--- a/tests/test_issues.py
+++ b/tests/test_issues.py
@@ -8,6 +8,7 @@ from __future__ import annotations
 import os
 import pickle
 
+import numpy as np
 import pytest
 
 import vector
@@ -47,3 +48,16 @@ def test_issue_161():
     with open(file_path, "rb") as f:
         a = ak.from_buffers(*pickle.load(f))
     repro(generator_like_jet_constituents=a.constituents)
+
+
+def test_issue_443():
+    ak = pytest.importorskip("awkward")
+    vector.register_awkward()
+
+    assert vector.array({"E": [1], "px": [1], "py": [1], "pz": [1]}) ** 2 == np.array(
+        [-2.0]
+    )
+    assert ak.zip(
+        {"E": [1], "px": [1], "py": [1], "pz": [1]}, with_name="Momentum4D"
+    ) ** 2 == ak.Array([-2])
+    assert vector.obj(E=1, px=1, py=1, pz=1) ** 2 == -2