Skip to content

[Costs] Bloq & Gate counts#958

Merged
mpharrigan merged 8 commits intoquantumlib:mainfrom
mpharrigan:2024-04/generic-costs-counts
May 30, 2024
Merged

[Costs] Bloq & Gate counts#958
mpharrigan merged 8 commits intoquantumlib:mainfrom
mpharrigan:2024-04/generic-costs-counts

Conversation

@mpharrigan
Copy link
Copy Markdown
Collaborator

This introduces two CostKeys to let you count gates in different ways. Part of #899

  • BloqCount takes a sequence of bloqs to count (based on equality)
  • QECGatesCost counts the common "leaf bloqs" we care about, cc More Leaf Bloqs #873

def test_hamiltonian_simulation_by_gqsp_t_complexity():
hubbard_time_evolution_by_gqsp = _hubbard_time_evolution_by_gqsp.make()
_ = hubbard_time_evolution_by_gqsp.t_complexity()
t_comp = hubbard_time_evolution_by_gqsp.t_complexity()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you just picked this test?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somewhat arbitrary -- seemed like a reasonably complicated example

@mpharrigan
Copy link
Copy Markdown
Collaborator Author

I've gone through all the bloq examples and validated that each bloq_example with a non-erroring t_complexity() has a matching get_cost_val(bloq, QECGatesCost).total_t_count().

This PR does not include rotations! Will do in a follow-up

@fdmalone fdmalone self-requested a review May 22, 2024 18:31
@mpharrigan mpharrigan merged commit bae2356 into quantumlib:main May 30, 2024
@mpharrigan mpharrigan mentioned this pull request Aug 22, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants