quantumlib / OpenFermion

The electronic structure package for quantum computers.
Apache License 2.0
1.52k stars 376 forks source link

Fix unexpected behavior of symmetry_conserving_bravyi_kitaev #734

Closed r-imai-quantum closed 3 years ago

r-imai-quantum commented 3 years ago

This pull request fixes the unexpected behavior of symmetry_conserving_bravyi_kitaev.

It is the following:

>>> symmetry_conserving_bravyi_kitaev(FermionOperator("3^ 3"), 8, 4)
0.5 [] +
-0.5 [Z0 Z1]

This is caused by prune_unused_indices, which deletes all unused indices.

The expected result is

0.5 [] +
-0.5 [Z3 Z4]
r-imai-quantum commented 3 years ago

Could someone please review it?

r-imai-quantum commented 3 years ago

Most of the SCBK features seem to be written by @sammcardle30 and @babbush. Would it be possible for you to review changes in this pull request?

r-imai-quantum commented 3 years ago

Thank you!