Metadata-Version: 2.4
Name: phlower-tensor
Version: 0.1.0
Summary: A PyTorch tensor extension for physical dimension-aware tensors.
Author: RICOS Co. Ltd.
License-Expression: Apache-2.0
Requires-Dist: einops>=0.8.1
Requires-Dist: numpy>=2.3.5
Requires-Dist: pipe>=2.2
Requires-Dist: scipy>=1.16.3
Requires-Dist: torch>=2.5.1 ; extra == 'cpu'
Requires-Dist: torchvision>=0.20.1 ; extra == 'cpu'
Requires-Dist: torch>=2.5.1 ; extra == 'cu118'
Requires-Dist: torchvision>=0.20.1 ; extra == 'cu118'
Requires-Dist: torch>=2.5.1 ; extra == 'cu124'
Requires-Dist: torchvision>=0.20.1 ; extra == 'cu124'
Maintainer: Riku Sakamoto
Maintainer-email: Riku Sakamoto <sakamoto@ricos.co.jp>
Requires-Python: >=3.11
Provides-Extra: cpu
Provides-Extra: cu118
Provides-Extra: cu124
Description-Content-Type: text/markdown

## phlower_tensor


### Description

This library is separated from [the main phlower library](https://github.com/ricosjp/phlower) 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:

```bash
pip install phlower-tensor
```


### Usage

Here is a simple example of how to use the phlower_tensor library:

```python
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](LICENSE) file for details.

