"""
nblade 类型存根文件

此文件为 IDE 和类型检查器提供类型信息。
实际实现在 Rust 扩展模块 _core 中。
"""

from typing import List, Tuple, Optional, overload

class AlgebraConfig:
    """代数配置类（Rust 实现）"""

    def __init__(self, dimension: int, p: int, q: int, r: int) -> None: ...
    @classmethod
    def euclidean(cls, dimension: int) -> "AlgebraConfig": ...
    @property
    def dimension(self) -> int: ...
    @property
    def basis_count(self) -> int: ...
    @property
    def signature(self) -> Tuple[int, int, int]: ...
    def volume_element(self) -> "MultiVector": ...
    def volume_element_squared(self) -> Optional[float]: ...
    def volume_element_inverse(self) -> Optional["MultiVector"]: ...
    def __repr__(self) -> str: ...
    def __str__(self) -> str: ...

class MultiVector:
    """
    多向量类（Rust 实现）

    表示几何代数中的多重向量元素，可以是标量、向量、
    二重向量、三重向量等的线性组合。
    """

    # 构造方法
    @classmethod
    def zeros(cls, config: AlgebraConfig) -> "MultiVector": ...
    @classmethod
    def one(cls, config: AlgebraConfig) -> "MultiVector": ...
    @classmethod
    def from_scalar(cls, config: AlgebraConfig, scalar: float) -> "MultiVector": ...
    @classmethod
    def basis_vector(cls, config: AlgebraConfig, i: int) -> "MultiVector": ...
    @classmethod
    def from_coefficients(
        cls, config: AlgebraConfig, coefficients: List[float]
    ) -> "MultiVector": ...
    @classmethod
    def from_numpy(
        cls, config: AlgebraConfig, array: "numpy.ndarray"
    ) -> "MultiVector": ...

    # 属性
    @property
    def config(self) -> AlgebraConfig: ...

    # 基本运算
    def scalar_part(self) -> float: ...
    def coefficients(self) -> List[float]: ...
    def grade(self, r: int) -> "MultiVector": ...
    def even_part(self) -> "MultiVector": ...
    def odd_part(self) -> "MultiVector": ...

    # 几何积和外积
    def geometric_product(self, other: "MultiVector") -> "MultiVector": ...
    def outer_product(self, other: "MultiVector") -> "MultiVector": ...

    # 内积
    def left_inner(self, other: "MultiVector") -> "MultiVector": ...
    def right_inner(self, other: "MultiVector") -> "MultiVector": ...

    # 对合运算
    def grade_involution(self) -> "MultiVector": ...
    def reversion(self) -> "MultiVector": ...
    def clifford_conjugate(self) -> "MultiVector": ...

    # 其他运算
    def dual(self) -> "MultiVector": ...
    def inverse_dual(self) -> "MultiVector": ...
    def inverse(self) -> "MultiVector": ...
    def scalar_product(self, other: "MultiVector") -> float: ...
    def norm_squared(self) -> float: ...
    def norm(self) -> float: ...
    def commutator(self, other: "MultiVector") -> "MultiVector": ...
    def scale(self, factor: float) -> "MultiVector": ...
    def add(self, other: "MultiVector") -> "MultiVector": ...

    # 几何运算
    def project_to(self, blade: "MultiVector") -> "MultiVector": ...
    def reject_from(self, blade: "MultiVector") -> "MultiVector": ...
    def reflect_in(self, blade: "MultiVector") -> "MultiVector": ...
    def rotate_by(self, rotor: "MultiVector") -> "MultiVector": ...

    # 检查方法
    def is_zero(self) -> bool: ...
    def is_invertible(self) -> bool: ...

    # Python 魔术方法
    @overload
    def __add__(self, other: "MultiVector") -> "MultiVector": ...
    @overload
    def __sub__(self, other: "MultiVector") -> "MultiVector": ...
    @overload
    def __mul__(self, other: "MultiVector") -> "MultiVector": ...
    @overload
    def __xor__(self, other: "MultiVector") -> "MultiVector": ...
    @overload
    def __or__(self, other: "MultiVector") -> "MultiVector": ...
    def __invert__(self) -> "MultiVector": ...
    def __neg__(self) -> "MultiVector": ...
    def __repr__(self) -> str: ...
    def __str__(self) -> str: ...

def create_rotor(plane: MultiVector, angle: float) -> MultiVector: ...
def reciprocal_frame(vectors: List[MultiVector]) -> List[MultiVector]: ...
def verify_reciprocal_frame(
    frame: List[MultiVector], reciprocal: List[MultiVector], tolerance: float
) -> None: ...
def metric_tensor(vectors: List[MultiVector]) -> List[List[float]]: ...
def basis_expansion(mv: MultiVector) -> List[Tuple[int, float]]: ...
def basis_reconstruction(
    config: AlgebraConfig, coefficients: List[Tuple[int, float]]
) -> MultiVector: ...

__version__: str
