{ }
View source on GitHub |
Restrict a Jordan-Wigner encoded state to a given Sz value
openfermion.linalg.jw_sz_restrict_state(
state,
sz_value,
n_electrons=None,
n_qubits=None,
up_index=openfermion.utils.up_index
,
down_index=openfermion.utils.down_index
)
Returns | |
---|---|
new_operator
|
ndarray or sparse
Numpy vector restricted to states with the desired Sz value. May not be normalized. |