quatint 0.0.3__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 3a49525171c7d4218706__mypyc.cp310-win_amd64.pyd +0 -0
- quatint/__init__.cp310-win_amd64.pyd +0 -0
- quatint/quat.cp310-win_amd64.pyd +0 -0
- quatint-0.0.3.dist-info/METADATA +66 -0
- quatint-0.0.3.dist-info/RECORD +10 -0
- quatint-0.0.3.dist-info/WHEEL +5 -0
- quatint-0.0.3.dist-info/licenses/LICENSE +19 -0
- quatint-0.0.3.dist-info/top_level.txt +3 -0
- quatint-stubs/__init__.pyi +0 -0
- quatint-stubs/quat.pyi +66 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quatint
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: A quatint class, for using quaternions backed by integers and half-integers (Hurwitz integers).
|
|
5
|
+
Author-email: Ryan Heard <ryanwheard@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/rheard/quatint
|
|
8
|
+
Keywords: complex,math
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: sympy<=1.12.1
|
|
20
|
+
Dynamic: license
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
This package provides a `hurwitzint` class for dealing with Hurwitz integers.
|
|
24
|
+
|
|
25
|
+
Float operations are avoided by this package for infinite precision. To input half-integers with infinite precision,
|
|
26
|
+
use the `half` argument as so:
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from quatint import hurwitzint
|
|
30
|
+
|
|
31
|
+
a = hurwitzint(3, 5, 7, 11)
|
|
32
|
+
|
|
33
|
+
print(a) # Outputs "3+5i+7j+11k"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from quatint import hurwitzint
|
|
40
|
+
|
|
41
|
+
a = hurwitzint(1, 2, 3, 4)
|
|
42
|
+
b = hurwitzint(2, 3, 4, 5)
|
|
43
|
+
|
|
44
|
+
c = a * b
|
|
45
|
+
print(c) # Outputs "-36+6i+12j+12k"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Disclaimer
|
|
49
|
+
|
|
50
|
+
This is intended for use with discrete mathematics, and ideally will be limited to the
|
|
51
|
+
operations: add, sub, mul, and pow.
|
|
52
|
+
|
|
53
|
+
Trying to divide using this class, or using floats with this class, will (probably) result in integer conversion cutoff.
|
|
54
|
+
|
|
55
|
+
As an example of this problem, note the equivalences below:
|
|
56
|
+
```python
|
|
57
|
+
from quatint import hurwitzint
|
|
58
|
+
|
|
59
|
+
a = hurwitzint(1, 2, 3, 4)
|
|
60
|
+
|
|
61
|
+
print(a / 3) # Outputs "i+j+k"
|
|
62
|
+
print(a / 3.5) # Outputs "i+j+k"
|
|
63
|
+
|
|
64
|
+
print(a + 1) # Outputs "2+2i+3j+4k"
|
|
65
|
+
print(a + 1.5) # Outputs "2+2i+3j+4k"
|
|
66
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
3a49525171c7d4218706__mypyc.cp310-win_amd64.pyd,sha256=tRKiEceIB3nPG6dC0ko0-DYzitZRLkKJ-KgZlhBFos4,169472
|
|
2
|
+
quatint/__init__.cp310-win_amd64.pyd,sha256=1uLkEoYUkUxDKilUP4fqeSdynLI6fwg7n4OGeXFeagE,10752
|
|
3
|
+
quatint/quat.cp310-win_amd64.pyd,sha256=bs2NbLvEtHGewRmeyVRIQKYf5m05IOlpcU0Bv4gtMG4,10752
|
|
4
|
+
quatint-0.0.3.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
|
5
|
+
quatint-stubs/__init__.pyi,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
quatint-stubs/quat.pyi,sha256=ZUwLWyOH-OIXcm2ZrvvotxcuhtDgivtMACD-kPS8njg,2948
|
|
7
|
+
quatint-0.0.3.dist-info/METADATA,sha256=aGIvEu8JwZJWHNkoK5TgjascAR1VdoUWaW6ScwwetWg,1939
|
|
8
|
+
quatint-0.0.3.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
|
|
9
|
+
quatint-0.0.3.dist-info/top_level.txt,sha256=5Ii4PDUZslezIEwK0uNjzWWkUXsBRi96NKCuuYLNDGA,50
|
|
10
|
+
quatint-0.0.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2018 The Python Packaging Authority
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
File without changes
|
quatint-stubs/quat.pyi
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from _typeshed import Incomplete
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Iterator
|
|
4
|
+
|
|
5
|
+
OTHER_OP_TYPES = int | float
|
|
6
|
+
OP_TYPES: Incomplete
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class HurwitzFactorization:
|
|
10
|
+
content: int
|
|
11
|
+
unit: hurwitzint
|
|
12
|
+
primes: tuple['hurwitzint', ...]
|
|
13
|
+
|
|
14
|
+
def mod_sqrt_prime(n: int, p: int) -> int | None: ...
|
|
15
|
+
|
|
16
|
+
class hurwitzint:
|
|
17
|
+
a: int
|
|
18
|
+
b: int
|
|
19
|
+
c: int
|
|
20
|
+
d: int
|
|
21
|
+
def __init__(self, a: int = 0, b: int = 0, c: int = 0, d: int = 0, *, half: bool = False) -> None: ...
|
|
22
|
+
@property
|
|
23
|
+
def is_lipschitz(self) -> bool: ...
|
|
24
|
+
@property
|
|
25
|
+
def den(self) -> int: ...
|
|
26
|
+
def conjugate(self) -> hurwitzint: ...
|
|
27
|
+
def components2(self) -> tuple[int, int, int, int]: ...
|
|
28
|
+
def __add__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
29
|
+
def __radd__(self, other: OTHER_OP_TYPES) -> hurwitzint: ...
|
|
30
|
+
def __sub__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
31
|
+
def __rsub__(self, other: OTHER_OP_TYPES) -> hurwitzint: ...
|
|
32
|
+
def __neg__(self) -> hurwitzint: ...
|
|
33
|
+
def __pos__(self) -> hurwitzint: ...
|
|
34
|
+
def __mul__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
35
|
+
def __rmul__(self, other: OTHER_OP_TYPES) -> hurwitzint: ...
|
|
36
|
+
def __pow__(self, exp: int) -> hurwitzint: ...
|
|
37
|
+
def __divmod__(self, other: OP_TYPES) -> tuple['hurwitzint', 'hurwitzint']: ...
|
|
38
|
+
def __truediv__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
39
|
+
def __rtruediv__(self, other: OTHER_OP_TYPES) -> hurwitzint: ...
|
|
40
|
+
def __floordiv__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
41
|
+
def __rfloordiv__(self, other: OTHER_OP_TYPES) -> hurwitzint: ...
|
|
42
|
+
def __mod__(self, other: OP_TYPES) -> hurwitzint: ...
|
|
43
|
+
def rdivmod(self, other: OP_TYPES) -> tuple['hurwitzint', 'hurwitzint']: ...
|
|
44
|
+
def rtruediv(self, other: OP_TYPES) -> hurwitzint: ...
|
|
45
|
+
def rfloordiv(self, other: OP_TYPES) -> hurwitzint: ...
|
|
46
|
+
def rmod(self, other: OP_TYPES) -> hurwitzint: ...
|
|
47
|
+
def __abs__(self) -> int: ...
|
|
48
|
+
def __bool__(self) -> bool: ...
|
|
49
|
+
def __iter__(self) -> Iterator[int]: ...
|
|
50
|
+
def __len__(self) -> int: ...
|
|
51
|
+
def __getitem__(self, idx: int) -> int: ...
|
|
52
|
+
def __eq__(self, other: object) -> bool: ...
|
|
53
|
+
def __hash__(self) -> int: ...
|
|
54
|
+
def gcd_right(self, other: OP_TYPES, *, normalize: bool = True) -> hurwitzint: ...
|
|
55
|
+
def gcd_left(self, other: OP_TYPES, *, normalize: bool = True) -> hurwitzint: ...
|
|
56
|
+
@staticmethod
|
|
57
|
+
def units() -> tuple['hurwitzint', ...]: ...
|
|
58
|
+
def content(self) -> int: ...
|
|
59
|
+
def factor_right(self) -> HurwitzFactorization: ...
|
|
60
|
+
def factor_left(self) -> HurwitzFactorization: ...
|
|
61
|
+
|
|
62
|
+
def rdivmod(a: hurwitzint, b: OP_TYPES) -> tuple['hurwitzint', 'hurwitzint']: ...
|
|
63
|
+
def gcd_left(a: hurwitzint, b: OP_TYPES) -> hurwitzint: ...
|
|
64
|
+
def gcd_right(a: hurwitzint, b: OP_TYPES) -> hurwitzint: ...
|
|
65
|
+
def prod_right(x: Iterator[OP_TYPES], unit: hurwitzint | None = None): ...
|
|
66
|
+
def prod_left(x: Iterator[OP_TYPES], unit: hurwitzint | None = None): ...
|