Loading python/examples/pyscf_qubit_tapering.py 0 → 100644 +5 −0 Original line number Diff line number Diff line from qcor import * H = createOperator('pyscf', {'basis': 'sto-3g', 'geometry': 'H 0.000000 0.0 0.0\nH 0.0 0.0 .7474'}) print('\nOriginal:\n', H.toString()) H_tapered = operatorTransform('qubit-tapering', H) print('\nTapered:\n', H_tapered) python/py-qcor.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -522,7 +522,7 @@ PYBIND11_MODULE(_pyqcor, m) { m.def( "createOperator", [](const std::string &type, const std::string &repr) { return qcor::createOperator(type, repr); auto op = qcor::createOperator(type, repr); }, ""); m.def( Loading @@ -549,6 +549,12 @@ PYBIND11_MODULE(_pyqcor, m) { }, ""); m.def( "operatorTransform", [](const std::string &type, std::shared_ptr<Observable> obs) { return qcor::operatorTransform(type, obs); }, ""); m.def( "internal_observe", [](std::shared_ptr<CompositeInstruction> kernel, Loading Loading
python/examples/pyscf_qubit_tapering.py 0 → 100644 +5 −0 Original line number Diff line number Diff line from qcor import * H = createOperator('pyscf', {'basis': 'sto-3g', 'geometry': 'H 0.000000 0.0 0.0\nH 0.0 0.0 .7474'}) print('\nOriginal:\n', H.toString()) H_tapered = operatorTransform('qubit-tapering', H) print('\nTapered:\n', H_tapered)
python/py-qcor.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -522,7 +522,7 @@ PYBIND11_MODULE(_pyqcor, m) { m.def( "createOperator", [](const std::string &type, const std::string &repr) { return qcor::createOperator(type, repr); auto op = qcor::createOperator(type, repr); }, ""); m.def( Loading @@ -549,6 +549,12 @@ PYBIND11_MODULE(_pyqcor, m) { }, ""); m.def( "operatorTransform", [](const std::string &type, std::shared_ptr<Observable> obs) { return qcor::operatorTransform(type, obs); }, ""); m.def( "internal_observe", [](std::shared_ptr<CompositeInstruction> kernel, Loading