# Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
# Copyright (c) 2025 Munich Quantum Software Company GmbH
# All rights reserved.
#
# SPDX-License-Identifier: MIT
#
# Licensed under the MIT License

"""Python bindings for hybrid mapper module."""

from typing import ClassVar, overload

from mqt.core.ir import QuantumComputation

class InitialCoordinateMapping:
    __members__: ClassVar[dict[str, int]] = ...  # read-only
    __entries: ClassVar[dict[str, int]] = ...
    random: ClassVar[InitialCoordinateMapping] = ...
    trivial: ClassVar[InitialCoordinateMapping] = ...

    @overload
    def __init__(self, value: int) -> None: ...
    @overload
    def __init__(self) -> None: ...
    def __eq__(self, other: object) -> bool: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...

class InitialCircuitMapping:
    __members__: ClassVar[dict[str, int]] = ...  # read-only
    __entries: ClassVar[dict[str, int]] = ...
    identity: ClassVar[InitialCircuitMapping] = ...

    @overload
    def __init__(self, value: int) -> None: ...
    @overload
    def __init__(self, arg0: str) -> None: ...
    def __eq__(self, other: object) -> bool: ...
    def __hash__(self) -> int: ...
    def __index__(self) -> int: ...
    def __int__(self) -> int: ...
    def __ne__(self, other: object) -> bool: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...

class HybridMapperParameters:
    decay: float
    gate_weight: float
    initial_mapping: InitialCoordinateMapping
    lookahead_weight_moves: float
    lookahead_weight_swaps: float
    seed: int
    shuttling_time_weight: float
    shuttling_weight: float
    verbose: bool
    @overload
    def __init__(self) -> None: ...
    @overload
    def __init__(
        self,
        lookahead_weight_swaps: float = ...,
        lookahead_weight_moves: float = ...,
        decay: float = ...,
        shuttling_time_weight: float = ...,
        gate_weight: float = ...,
        shuttling_weight: float = ...,
    ) -> None: ...

class HybridNAMapper:
    """The hybrid mapper for Neutral Atom Quantum Computers."""
    def __init__(self, arch: NeutralAtomHybridArchitecture, params: HybridMapperParameters = ...) -> None: ...
    def get_animation_csv(self) -> str: ...
    def get_init_hw_pos(self) -> dict[int, int]: ...
    def get_mapped_qc(self) -> str: ...
    def get_mapped_qc_aod(self) -> str: ...
    def map(
        self, circ: QuantumComputation, initial_mapping: InitialCircuitMapping = ..., verbose: bool = ...
    ) -> None: ...
    def map_qasm_file(
        self, filename: str, initial_mapping: InitialCircuitMapping = ..., verbose: bool = ...
    ) -> None: ...
    def save_animation_csv(self, filename: str) -> None: ...
    def save_mapped_qc(self, filename: str) -> None: ...
    def save_mapped_qc_aod(self, filename: str) -> None: ...
    def schedule(
        self, verbose: bool = ..., create_animation_csv: bool = ..., shuttling_speed_factor: float = ...
    ) -> dict[str, float]: ...
    def set_parameters(self, params: HybridMapperParameters) -> None: ...

class NeutralAtomHybridArchitecture:
    """Class representing the architecture of a Neutral Atom Quantum Computer."""

    name: str

    def __init__(self, filename: str) -> None: ...
    def compute_swap_distance(self, idx1: int, idx2: int) -> float: ...
    def get_animation_csv(self) -> str: ...
    def get_gate_average_fidelity(self, s: str) -> float: ...
    def get_gate_time(self, s: str) -> float: ...
    def get_nearby_coordinates(self, idx: int) -> set[int]: ...
    def load_json(self, json_filename: str) -> None: ...
    def save_animation_csv(self, filename: str) -> None: ...
    @property
    def blocking_factor(self) -> float: ...
    @property
    def decoherence_time(self) -> float: ...
    @property
    def inter_qubit_distance(self) -> float: ...
    @property
    def interaction_radius(self) -> float: ...
    @property
    def naod_coordinates(self) -> int: ...
    @property
    def naod_intermediate_levels(self) -> int: ...
    @property
    def naods(self) -> int: ...
    @property
    def ncolumns(self) -> int: ...
    @property
    def npositions(self) -> int: ...
    @property
    def nqubits(self) -> int: ...
    @property
    def nrows(self) -> int: ...
