Core (Rust extension)#
The ferrmion.core module contains the Rust-accelerated functions that power
the encoding and optimisation pipelines. All functions are compiled via PyO3 and
available directly on the ferrmion namespace through re-exports in
ferrmion/__init__.py.
- ferrmion.core.anneal_enumerations(ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectics: ndarray[tuple[int, ...], dtype[bool]], signatures: list[str], coeffs: list[ndarray], temperature: float, initial_guess: ndarray[tuple[int, ...], dtype[uint64]], coefficient_weighted: bool, seed: int | None = None) tuple[ndarray[tuple[int, ...], dtype[uint8]], ndarray[tuple[int, ...], dtype[bool]]][source]#
- ferrmion.core.batch_pauli_weights(ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectics: ndarray[tuple[int, ...], dtype[bool]], vacuum_state: ndarray[tuple[int, ...], dtype[bool]], signatures: list[str], coeffs: list[ndarray], permutations: ndarray[tuple[int, ...], dtype[uint64]]) tuple[ndarray[tuple[int, ...], dtype[float64]], ndarray[tuple[int, ...], dtype[float64]]][source]#
- ferrmion.core.clifford_heuristic(qham: dict[str, complex], n_qubits: int, temperature: float, coefficient_weighted: bool, seed: int | None = None, clifford_subset: str = Ellipsis) dict[source]#
- ferrmion.core.decode(states: ndarray[tuple[int, ...], dtype[bool]], ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectic_matrix: ndarray[tuple[int, ...], dtype[bool]], vacuum_state: ndarray[tuple[int, ...], dtype[bool]]) ndarray[tuple[int, ...], dtype[bool]][source]#
- ferrmion.core.encode(ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectics: ndarray[tuple[int, ...], dtype[bool]], vacuum_state: ndarray[tuple[int, ...], dtype[bool]], signatures: list[str], coeffs: list[ndarray], constant_energy: float) dict[source]#
- ferrmion.core.encode_fermion_product(ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectics: ndarray[tuple[int, ...], dtype[bool]], signatures: str, indices: list[int], coefficient: complex) dict[source]#
- ferrmion.core.encode_topphatt(flatpack: list[tuple[uint64, tuple[uint64, uint64, uint64]]], n_qubits: int, signatures: list[str], coeffs: list[ndarray], constant_energy: float, parallelize: bool, heuristic: str = 'min_weight', seed: int | None = None) tuple[ndarray[tuple[int, ...], dtype[uint8]], ndarray[tuple[int, ...], dtype[bool]], dict, ndarray[tuple[int, ...], dtype[bool]]][source]#
- ferrmion.core.fermionic_to_sparse_majorana(signatures: list[str], coeffs: list[ndarray], constant_energy: float) dict[source]#
- ferrmion.core.flatpack_symplectic_matrix(flatpack: TTFlatpack, n_qubits: None | int) tuple[ndarray[tuple[int, ...], dtype[uint8]], ndarray[tuple[int, ...], dtype[bool]], ndarray[tuple[int, ...], dtype[bool]]][source]#
- ferrmion.core.hartree_fock_state(fermionic_hf_state: ndarray[tuple[int, ...], dtype[bool]], mode_op_map: ndarray[tuple[int, ...], dtype[uint64]], ipowers: ndarray[tuple[int, ...], dtype[uint8]], symplectic_matrix: ndarray[tuple[int, ...], dtype[bool]], vacuum_state: ndarray[tuple[int, ...], dtype[bool]]) ndarray[tuple[int, ...], dtype[bool]][source]#
- ferrmion.core.hatt(n_modes: int, signatures: list[str], coeffs: list[ndarray]) tuple[TTFlatpack, int][source]#
- ferrmion.core.pauli_to_symplectic(pauli: str, ipower: int) tuple[ndarray[tuple[int, ...], dtype[bool]], int][source]#
- ferrmion.core.randomised_subsystem_descent(qham: dict[str, complex], n_qubits: int, iterations: int, temperature: float, subsystem_dimension: int, coefficient_weighted: bool = Ellipsis, sampler: str = Ellipsis, seed: int | None = None, clifford_subset: str = Ellipsis) dict[source]#
- ferrmion.core.symplectic_product(left: ndarray[tuple[int, ...], dtype[bool]], right: ndarray[tuple[int, ...], dtype[bool]]) tuple[int, ndarray[tuple[int, ...], dtype[bool]]][source]#
- ferrmion.core.symplectic_to_pauli(symplectic: ndarray[tuple[int, ...], dtype[bool]], ipower: int) tuple[str, int][source]#
- ferrmion.core.symplectic_to_sparse(symplectic: ndarray[tuple[int, ...], dtype[bool]], ipower: int) tuple[str, ndarray[tuple[int, ...], dtype[uint64]], complex][source]#
- ferrmion.core.topphatt(flatpack: list[tuple[uint64, tuple[uint64, uint64, uint64]]], n_qubits: int, signatures: list[str], coeffs: list[ndarray], parallelize: bool, heuristic: str = 'min_weight', seed: int | None = None) tuple[ndarray[tuple[int, ...], dtype[uint8]], ndarray[tuple[int, ...], dtype[bool]], ndarray[tuple[int, ...], dtype[bool]]][source]#