diff --git a/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/prepare_t_test.py b/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/prepare_t_test.py index ba3c715a7..26e7cd87e 100644 --- a/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/prepare_t_test.py +++ b/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/prepare_t_test.py @@ -14,13 +14,13 @@ import pytest -from qualtran.bloqs.basic_gates import Toffoli from qualtran.bloqs.chemistry.pbc.first_quantization.projectile.prepare_t import ( _prep_power_two_proj, _prep_t_proj, PreparePowerTwoStateWithProj, PrepareTFirstQuantizationWithProj, ) +from qualtran.resource_counting import get_cost_value, QECGatesCost def test_prep_t_proj(bloq_autotester): @@ -40,12 +40,15 @@ def test_prepare_kinetic_t_proj_counts(): qual_cost = 0 prep = PrepareTFirstQuantizationWithProj(num_bits_p, num_bits_n, eta, num_bits_rot_aa=b_r) _, counts = prep.call_graph() - qual_cost += counts[Toffoli()] + counts = get_cost_value(prep, QECGatesCost()) + cost_dict = counts.total_t_and_ccz_count() + qual_cost += cost_dict['n_ccz'] prep = PrepareTFirstQuantizationWithProj( num_bits_p, num_bits_n, eta, num_bits_rot_aa=b_r ).adjoint() - _, counts = prep.call_graph() - qual_cost += counts[Toffoli()] + counts = get_cost_value(prep, QECGatesCost()) + cost_dict = counts.total_t_and_ccz_count() + qual_cost += cost_dict['n_ccz'] assert qual_cost == expected_cost diff --git a/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/select_t_test.py b/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/select_t_test.py index b654c30ac..7356c1e63 100644 --- a/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/select_t_test.py +++ b/qualtran/bloqs/chemistry/pbc/first_quantization/projectile/select_t_test.py @@ -11,11 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from qualtran.bloqs.basic_gates import Toffoli from qualtran.bloqs.chemistry.pbc.first_quantization.projectile.select_t import ( _sel_t_proj, SelectTFirstQuantizationWithProj, ) +from qualtran.resource_counting import get_cost_value, QECGatesCost def test_sel_t_proj(bloq_autotester): @@ -25,5 +25,6 @@ def test_sel_t_proj(bloq_autotester): def test_select_kinetic_t_counts(): num_bits_n = 6 sel = SelectTFirstQuantizationWithProj(num_bits_n, 10) - _, counts = sel.call_graph() - assert counts[Toffoli()] == 5 * (num_bits_n - 1) + 2 + 1 + counts = get_cost_value(sel, QECGatesCost()) + cost_dict = counts.total_t_and_ccz_count() + assert cost_dict['n_ccz'] == 5 * (num_bits_n - 1) + 2 + 1