Skip to main content

A PyTorch tensor extension for physical dimension-aware tensors.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phlower_tensor-0.1.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phlower_tensor-0.1.1-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

Details for the file phlower_tensor-0.1.1.tar.gz.

File metadata

  • Download URL: phlower_tensor-0.1.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.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}

File hashes

Hashes for phlower_tensor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf433a90b57278c2c44b0f6dcf844b3156bff6f4343cfce1a5eb9add2742274f
MD5 589734166fcc4cc5dca7f5571d6557df
BLAKE2b-256 2d3231137f679f13cf8ac9c4ff8ad72287b5adc848128a50ba48c260a7db5c63

See more details on using hashes here.

File details

Details for the file phlower_tensor-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: phlower_tensor-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.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}

File hashes

Hashes for phlower_tensor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a33c32e3f36655d50592c71eb6f5e5de57361e5a90da5ef976109b67ddc99684
MD5 ad6ed418d4e8ead8763326b35b2fd1b9
BLAKE2b-256 b90e16e4d21114b7f2d035cd75dd280bb8dc4ef0ef2afb4aa68ff5980bc50e2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page