Skip to main content

No project description provided

Project description

Onicescu Energy

A Python package for computing Onicescu's Informational Energy, particularly useful in quantum physics and information theory applications.

Overview

The onicescu_energy package provides a simple function to calculate Onicescu's Informational Energy for a given probability distribution. This measure quantifies the concentration or dispersion within a distribution and is defined as:

$$ E = \sum_{i=1}^{n} p_i^2 $$

For continuous distributions, it adapts to:

$$ E = \int [\rho(x)]^2 , dx $$

This concept is particularly relevant in quantum mechanics, where it can be used to analyze the localization properties of quantum states.

Installation

Install the package via pip:

pip install onicescu_energy

Dependencies

  • NumPy: A fundamental package for numerical computations in Python.

Usage

Import the necessary modules and the onicescu_energy.kinetic_energy function:

import numpy as np
from onicescu_energy import onicescu_energy

Computing Onicescu's Informational Energy

For a discrete probability distribution:

# Example discrete probability distribution
probabilities = np.array([0.2, 0.5, 0.3])

# Calculate Onicescu's Informational Energy
E = onicescu_energy.kinetic_energy(probabilities)

print(f"Onicescu's Informational Energy: {E}")

Computing for Quantum States

Suppose you have a quantum state represented by a wavefunction, and you want to compute the informational energy.

# Define the probability density function |(x)|²
def probability_density(x):
    # Example: |(x)|² = 2/L * sin²(nπx/L)
    L = 1.0  # Width of the potential well
    n = 1    # Energy level
    return (2 / L) * np.sin(n * np.pi * x / L)**2

# Generate a range of x values
x_values = np.linspace(0, 1, 1000)
dx = x_values[1] - x_values[0]

# Compute the probability densities
prob_densities = probability_density(x_values)

# For continuous distributions, approximate the integral
E = onicescu_energy.kinetic_energy(prob_densities) * dx

print(f"Onicescu's Informational Energy for the quantum state: {E}")

Function Definition

The onicescu_energy.kinetic_energy function computes the informational energy for a given array of probabilities or probability densities.

def kinetic_energy(probabilities):
    """
    Calculates Onicescu's Informational Energy.

    Parameters:
        probabilities (numpy.array): An array of probabilities or probability densities.

    Returns:
        float: The calculated informational energy.
    """
    return np.sum(probabilities**2)

Important Notes

  • Ensure that the probabilities or probability densities provided are properly normalized.

    • Discrete distributions: Probabilities should sum up to 1.

    • Continuous distributions: The integral of the probability density over the entire space should be 1.

  • When working with continuous distributions, multiplying by the differential element (e.g., dx) is necessary to approximate the integral.

License

This project is licensed under the MIT License.

Author

[Daia Alexandru]

Contribution

Contributions are welcome! Please feel free to submit issues or pull requests.

Contact

For any questions or inquiries, please contact alexandru.daia@vk.com.

Acknowledgments

  • Inspired by the work on Onicescu's Informational Energy in quantum physics.
  • Special thanks to the open-source community for providing the tools that make this package possible.

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

kinetic_energy-0.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

kinetic_energy-0.3-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file kinetic_energy-0.3.tar.gz.

File metadata

  • Download URL: kinetic_energy-0.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for kinetic_energy-0.3.tar.gz
Algorithm Hash digest
SHA256 ee2ddfb54c6a93f39b206d59eccc50d0d6e67e647fe0621569e2708cde085bc1
MD5 a1b8ecfa44d472ed8ddc57b89bc794ac
BLAKE2b-256 5b48a83305d1f1b32a7ef18738b17e3f78ac6a08156b9ab5f5b960e45a3b34b0

See more details on using hashes here.

File details

Details for the file kinetic_energy-0.3-py3-none-any.whl.

File metadata

  • Download URL: kinetic_energy-0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.9

File hashes

Hashes for kinetic_energy-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 599e3fab889fecb491315f05e446fde94148c16bdc7542f6f1682e69060f1ce3
MD5 3c5264ac571b9da0c14b067d519aaac1
BLAKE2b-256 ce2ae3fe07e7f71c7487311af3ca757a268075543e016577e7a41fb5dd5c72ed

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