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

Enhances EmbeddingOpFactory to be used to create target-qubit-dependent operation factories #338

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

enielse
Copy link
Collaborator

@enielse enielse commented Aug 11, 2023

Alters behavior of EmbeddingOpFactory to pass state space labels of operations being created through to a contained (embedded) operation factory object.

Previously, when an EmbeddingOpFactory would "blank out" (set to None) the sslbls argument passed to the contained op-factory's create_op call. Now this argument receives the original sslbls and so the contained factory can use this information to create different operations depending on what the operation's target qubits are.

This PR updates assertions in UnitaryOpFactory and an example in the operation factory tutorial that no longer hold in generatlity.

…ded factory.

Previously, when an EmbeddingOpFactory was called on to create an operation for
a set of state space labels (sslbls) it would *not* pass these labels to the
contained (embedded) factory.  The thinking (if I remember correctly) was that this
information wouldn't be needed by the contained factory since the EmbeddingOpFactory
would handle all of the embedding.  While this latter statement is true the contained
factory *does* need the sslbls if its job is to create different operations on different
target qubits - even though the operation being constructed is a local (e.g. 2-qubit out
of the N total qubits) one.

Previously in the call to EmbeddedOpFactory.create_op `None` as passed down to the contained
factory's create_op call instead of the original `sslbls`.  This commit updates this so
that `sslbls` is passed through.

This means that in UnitaryOpFactory and in user-defined factories the `sslbls` parameter
of create_op will no longer be `None` all the time (specifically when such factories are
used with EmbeddingOpFactory objects) and so assertions that this be the case have been
removed from UnitaryOpFactory and the user-defined factory in the OperationFactories.ipynb
tutorial notebook.
@enielse enielse requested a review from sserita August 11, 2023 15:28
@sserita sserita merged commit 8526a7b into develop Aug 15, 2023
13 checks passed
@sserita sserita deleted the feature-opfactory-sslbls branch August 15, 2023 15:56
sserita added a commit that referenced this pull request Sep 13, 2023
This should fix the extra tests broken since PR #338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants