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.2.tar.gz (27.5 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.2-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phlower_tensor-0.1.2.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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.2.tar.gz
Algorithm Hash digest
SHA256 420e1058773f21070ff9ff9c3c1c9b55e09e728c2eba00a51a5a76c67640d19e
MD5 46c14b79220900e84c4ff328b8b658e5
BLAKE2b-256 182147f4bca1d6a70b811bd6096d09e441abba2a330b4527985fb5de10a5b07f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phlower_tensor-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 34ed62049d0889023678b5a507d6af7f8da7698b6771189b0acb7cfeaf45c89a
MD5 1f63f98cd168abfd68967a24a642cd2e
BLAKE2b-256 8d0853e7ed09db3dc8aa47a07efe081d3f4d86aca6e3f32695dde85f08105715

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