Skip to content

Commit

Permalink
Clean up duplicated code Openfermion (#86)
Browse files Browse the repository at this point in the history
* Removed duplicate of Openfermion code
  • Loading branch information
alexfleury-sb authored Nov 15, 2021
1 parent fdfff15 commit c4da558
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 669 deletions.
367 changes: 0 additions & 367 deletions qsdk/toolboxes/ansatz_generator/_unitary_cc.py

This file was deleted.

2 changes: 1 addition & 1 deletion qsdk/toolboxes/ansatz_generator/uccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
import itertools
import numpy as np
from pyscf import mp
from openfermion.circuits import uccsd_singlet_generator

from qsdk.backendbuddy import Circuit

from .ansatz import Ansatz
from .ansatz_utils import pauliword_to_circuit
from ._unitary_cc import uccsd_singlet_generator
from ._unitary_cc_openshell import uccsd_openshell_paramsize, uccsd_openshell_generator
from qsdk.toolboxes.qubit_mappings.mapping_transform import fermion_to_qubit_mapping
from qsdk.toolboxes.qubit_mappings.statevector_mapping import get_reference_circuit
Expand Down
6 changes: 1 addition & 5 deletions qsdk/toolboxes/qubit_mappings/bravyi_kitaev.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

from openfermion.utils import count_qubits
from openfermion.transforms import bravyi_kitaev as openfermion_bravyi_kitaev
from qsdk.toolboxes.operators import QubitOperator


def bravyi_kitaev(fermion_operator, n_qubits):
Expand Down Expand Up @@ -51,7 +50,4 @@ def bravyi_kitaev(fermion_operator, n_qubits):

qubit_operator = openfermion_bravyi_kitaev(fermion_operator, n_qubits=n_qubits)

converted_qubit_op = QubitOperator()
converted_qubit_op.terms = qubit_operator.terms.copy()

return converted_qubit_op
return qubit_operator
Loading

0 comments on commit c4da558

Please sign in to comment.