qiskit_addon_sqd.qubit.solve_qubit

solve_qubit(bitstring_matrix, hamiltonian, *, verbose=False, **scipy_kwargs)[source]

Find the energies and eigenstates of a Hamiltonian projected into a subspace.

The subspace is defined by a collection of computational basis states which are specified by the bitstrings (rows) in the bitstring_matrix.

This function calls scipy.sparse.linalg.eigsh for the diagonalization.

Parameters:
  • bitstring_matrix (ndarray) – A 2D array of bool representations of bit values such that each row represents a single bitstring. This set of bitstrings specifies the subspace into which the hamiltonian will be projected and diagonalized.

  • hamiltonian (SparsePauliOp) – A Hamiltonian specified as a Pauli operator.

  • verbose (bool) – Whether to print the stage of the subroutine.

  • **scipy_kwargs

    Keyword arguments to be passed to scipy.sparse.linalg.eigsh.

Returns:

  • 1D array with the eigenvalues

  • 2D array with the eigenvectors. Each column represents an eigenvector.

Raises:

ValueError – Bitstrings (rows) in bitstring_matrix must have length < 64.

Return type:

tuple[ndarray, ndarray]