# Quickstart

## Installation 📦
Magnetron has packages on PyPi, so the installation is quite easy:
Using pip:
```pip install magnetron```
Using uv:
```uv pip install magnetron```

**Please note** that Magnetron is under **active development**, and the PyPI release may lag behind the latest features and improvements.
For the most up-to-date version, clone the repository from GitHub and build it locally from the development branch (requires **uv** to be installed):
```
git clone -b develop https://github.com/MarioSieg/magnetron && cd magnetron
uv venv && source .venv/bin/activate
uv pip install .
```

### Importing
The best one linter to import Magnetron locally is:
```python
from magnetron import Tensor, nn, optim, dtype
```
This imports the **Tensor class**, which provides most core tensor operations and functionality, the **nn module** containing high-level building blocks such as nn.Linear and nn.Sequential, and the **optim module**, which provides optimization algorithms and related utilities. The **dtype module** exposes built-in data types.

## Your First Magnetron Script
Let's multiply two random matrices using Magnetron:
```python
from magnetron import Tensor

a = Tensor.uniform(2, 3) # Create a 2x3 matrix with random values
b = Tensor.uniform(3, 4) # Create a 3x4 matrix with random values
c = a @ b  # Matrix multiplication
print(c) # Display the resulting 2x4 matrix
```