phlower_tensor
Description
This library is separated from the main phlower library to provide tensor operations and utilities that can be used independently. It includes tensor objects which have physical dimensions, as well as various tensor operations such as addition, multiplication, contraction, and more.
Installation
You can install the library using pip:
pip install phlower-tensor
Usage
Here is a simple example of how to use the phlower_tensor library:
import torch
from phlower_tensor import phlower_tensor
# Create two tensors with physical dimensions
velocity = phlower_tensor(torch.rand(100, 3), dimension={"T": -1, "L": 1})
mass = phlower_tensor(torch.rand(100, 1), dimension={"M": 1})
kinetic_energy = 0.5 * mass * (velocity ** 2)
print(kinetic_energy.dimension)
# Output: PhlowerDimensionTensor(T: -2.0, L: 2.0, M: 1.0, I: 0.0, Theta: 0.0, N: 0.0, J: 0.0)
Physical dimensions are represented as dictionaries where keys are dimension symbols (e.g., "L" for length, "T" for time) and values are their respective exponents.
| Symbol | Dimension |
|---|---|
| L | Length |
| T | Time |
| M | Mass |
| I | Electric Current |
| Theta | Temperature |
| N | Amount of Substance |
| J | Luminous Intensity |
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
Metadata
Release files for phlower-tensor 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| phlower_tensor-0.1.3.tar.gz | 31.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| phlower_tensor-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.8 kB
Release files / phlower_tensor-0.1.3.tar.gz
| Download URL | phlower_tensor-0.1.3.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07179655be7ad49d9aa66adfa5f1761962969a75ba30ef9cca9d495dde65e7b1
|
|
BLAKE2b-256 checksum How to use checksums |
163badb1451356dbf4c4af6e23f31bcc319b3a71e923847dbc5a88317e8c75c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phlower_tensor-0.1.3-py3-none-any.whl
| Download URL | phlower_tensor-0.1.3-py3-none-any.whl |
|---|---|
| Size | 48.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3358184532d02c9982d73626519b5207eee481de1f7697258a7ecb4a0cb8dab
|
|
BLAKE2b-256 checksum How to use checksums |
014e97866fefc391166c5b148b2e3d46f10fd8e858fcf156937fa58aabd74a03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|