Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

parse_backend_hamiltonian_dict return type hint is wrong #393

@NeoFantom

Description

@NeoFantom

Currently, this function from qiskit_dynamics.backend.backend_string_parser is defined as this signature:

def parse_backend_hamiltonian_dict(
    hamiltonian_dict: dict, subsystem_list: Optional[List[int]] = None
) -> Tuple[np.ndarray, np.ndarray, List[str], dict]:

However, according to the documentation and its code:

    return (
        static_hamiltonian,
        list(hamiltonian_operators),
        list(reduced_channels),
        subsystem_dims_dict,
    )

The second returned variable should be List[np.ndarray]. Please fix this type hint as it is very annoying when using static type check tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions