Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow BlockCollector to split blocks into depth-1 layers #9813

Open
chriseclectic opened this issue Mar 17, 2023 · 0 comments
Open

Allow BlockCollector to split blocks into depth-1 layers #9813

chriseclectic opened this issue Mar 17, 2023 · 0 comments
Labels
type: feature request New feature or request

Comments

@chriseclectic
Copy link
Member

What should we add?

Would it be possible to add to BlockCollector.collect_all_matching_blocks the ability to optionally split the collected blocks into layers of depth 1? Currently it can only split based on disjoint qubit sets.

For an example, imagine collecting all blocks of 2 qubit gates, and then splitting them into layers of depth 1. Eg I might have a non-split block like (represented by barriers below):

      ░                 ░ 
q_0: ─░───■─────────■───░─
      ░ ┌─┴─┐     ┌─┴─┐ ░ 
q_1: ─░─┤ X ├──■──┤ X ├─░─
      ░ └───┘┌─┴─┐└───┘ ░ 
q_2: ─░───■──┤ X ├──■───░─
      ░ ┌─┴─┐└───┘┌─┴─┐ ░ 
q_3: ─░─┤ X ├─────┤ X ├─░─
      ░ └───┘     └───┘ ░ 

and want it to be separated into multiple blocks of depth-1

      ░       ░       ░       ░ 
q_0: ─░───■───░───────░───■───░─
      ░ ┌─┴─┐ ░       ░ ┌─┴─┐ ░ 
q_1: ─░─┤ X ├─░───■───░─┤ X ├─░─
      ░ └───┘ ░ ┌─┴─┐ ░ └───┘ ░ 
q_2: ─░───■───░─┤ X ├─░───■───░─
      ░ ┌─┴─┐ ░ └───┘ ░ ┌─┴─┐ ░ 
q_3: ─░─┤ X ├─░───────░─┤ X ├─░─
      ░ └───┘ ░       ░ └───┘ ░ 


@chriseclectic chriseclectic added the type: feature request New feature or request label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant