semvec/pypi-packages huggingface dataset:
pytorch-nd-semiconv 0.1.2
N-dimensional convolutional operators for various semifields
Requires Python: >=3.10

# Pytorch N-Dimensional Semifield Convolutions

[Documentation](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html)
| [PyPi](https://pypi.org/project/pytorch-nd-semiconv/)

PyTorch provides efficient implementations of linear convolution operators, as well
as max-pooling operators. Both of these operators can be considered a kind of
semifield convolution, where the semifield defines what 'addition' and 'multiplication'
mean.

However, there are other semifields that we may wish to use than the linear.
As such, this package aims to simplify the process of implementing new semifield
convolutions, as well as providing definitions for standard semifields.

These new semifields can be defined using PyTorch broadcasting operators using
[
BroadcastSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.BroadcastSemifield),
or using [
SelectSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.SelectSemifield)
/ [
SubtractSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.SubtractSemifield)
in the cases where no appropriate PyTorch operator exists.

The implementations, while not as optimised as the base PyTorch versions,
have decent performance. [
BroadcastSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.BroadcastSemifield)
relies on chaining optimised
PyTorch operators but suffers from higher memory usage, while [
SelectSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.SelectSemifield)
/ [
SubtractSemifield](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html#pytorch_nd_semiconv.SubtractSemifield)
are custom CUDA operators, optionally JIT compiled into PyTorch
extensions using my other library [
pytorch-numba-extension-jit](https://p-adema.github.io/quadratic-conv/pytorch-numba-extension-jit/docs.html).

Finally, all three implementations work in arbitrary dimensionality: they support 1D,
2D or any dimensionality of inputs and kernels (though the example kernels provided
are only 2D).

This package is [listed on PyPi](https://pypi.org/project/pytorch-nd-semiconv/);
it can be installed with

`pip install pytorch-nd-semiconv`
pytorch-numba-extension-jit 0.1.6
Generate PyTorch Custom Operators from Numba-CUDA kernels
Requires Python: >=3.10

# Pytorch-Numba Extension JIT

[Documentation](https://p-adema.github.io/quadratic-conv/pytorch-numba-extension-jit/docs.html)
| [PyPi](https://pypi.org/project/pytorch-numba-extension-jit/)

Writing custom CUDA operators in C and CPP can make certain operations significantly
more efficient, but requires setting up a full C++ project and involves a great deal of
boilerplate.
Writing CUDA kernels using `numba-cuda` is significantly easier, but incurs overhead on
every call, and still requires some boilerplate to integrate with the tracing systems
that underlie `torch.compile`.

However, many of the CUDA kernels that would be used for deep learning are relatively
similar (read from a set of input arrays, write to output arrays).
As such, most of the boilerplate and binding code for C++ extensions
could be generated automatically.

This project aims to do exactly that: `pnex.jit` takes a Python function in the form of a Numba CUDA
kernel, along with some type annotations, and compiles a user-friendly and
highly-performant PyTorch C++ extension.

Additionally, if a convenient wrapper for PyTorch Custom Operators is all that is desired,
this library also allows skipping the C++ compilation phase and only generating the
boilerplate for a Custom Operator definition.

For an example usage of this package, see my other
package [pytorch-nd-semiconv](https://p-adema.github.io/quadratic-conv/pytorch-nd-semiconv/docs.html)

This package is [listed on PyPi](https://pypi.org/project/pytorch-numba-extension-jit/);
it can be installed with

`pip install pytorch-numba-extension-jit`
tipe-sim 1.2.1
A Python library to generate professional TIPE simulations using the Gemini API.
Requires Python: >=3.6

# TIPE SIM

A Python library to generate professional, topic-aware simulations for TIPE projects using the power of the Gemini API.

## Features

-   **AI-Powered:** Simply provide your TIPE topic (`sujet`).
-   **Intelligent Design:** The AI analyzes your topic and chooses the best visualization tools (graphs, 2D/3D canvas, etc.).
-   **Professional Dashboards:** Generates a single, complete HTML file with a modern dashboard layout.
-   **Academically Rigorous:** Includes real-time data, user controls, and correctly rendered mathematical explanations.

## Installation

You can install the library using pip:

```bash
pip install tipe-sim

Usage
Here is an example of how a user can run your library. They can save this code as a Python file (e.g., run_simulation.py) and execute it from their terminal.

# test_simulation.py
# An interactive script to test your tipe_sim library.

from tipe_sim import tsim
import os

def main():
    """Main function to run the interactive test."""
    
    print("--- TIPE Simulation Generator ---")
    
    # 1. Get API Key from environment variables.
    api_key = os.environ.get("GEMINI_API_KEY")
    if not api_key:
        print("\nERROR: The GEMINI_API_KEY environment variable is not set!")
        print("Please set it before running the script.")
        return # Exit the script

    # 2. Get the TIPE topic from the user interactively.
    print("\nPlease enter your TIPE topic (sujet):")
    my_sujet = input("> ")

    if not my_sujet:
        print("Topic cannot be empty. Exiting.")
        return

    # 3. Ask the user for a filename.
    print("\nEnter a filename for the output simulation (e.g., my_simulation.html):")
    output_filename = input("> ")
    if not output_filename.endswith('.html'):
        output_filename += '.html'

    # 4. Generate the simulation.
    print(f"\nGenerating simulation for: '{my_sujet}'...")
    try:
        html_content = tsim(sujet=my_sujet, api_key=api_key, output_path=output_filename)
        
        if html_content:
            print(f"\n✅ Simulation generated successfully!")
            print(f"File saved to: {os.path.abspath(output_filename)}")
        else:
            print("\n❌ Simulation generation failed. Please check the error messages above.")

    except Exception as e:
        print(f"\nAn unexpected error occurred: {e}")

if __name__ == "__main__":
    main()