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

germsel.find_germs() does not support operations.ComposedOp() and is limited in large models. #481

Open
Pablovinas opened this issue Aug 28, 2024 · 2 comments
Assignees
Labels
enhancement Request for a new feature or a change to an existing feature
Milestone

Comments

@Pablovinas
Copy link

germsel.find_germs() Fails with Composed Gates in Two-Qubit Systems

When performing GST on a two-qubit system , the function germsel.find_germs() fails to find germs if any of the gates in the model are defined using operations.ComposedOp(). It is usually the case that some layers in two-qubit systems are built using the composition of one-qubit gates via tensor product. If one considers crosstalk, each of those layers should be regarded as an independent gate to characterise. However, germsel.find_germs() currently only supports gates defined directly in the two-qubit Hilbert space and not those created using operations.ComposedOp(). If that is the case, an error is encountered with the message: TypeError: unsupported operand type(s) for *: 'float' and 'ComposedOp'. This is because the function randomize_with_unitary()contains the code line: mdl_randomized.operations[opLabel] = _op.FullArbitraryOp(_np.dot(randOp, gate)). To solve this issue, I think it would be necessary to substitute gate -> gate.to_dense() in the mentioned code line, so that the .dot() product is compatible with the format of the matrix.

Gate Label Limitation in Circuit.to_pythonstr()

Additionally, I have observed that germsel.find_germs() utilises the function Circuit.to_pythonstr(). This encodes circuits as python strings, using a single letter for each gate in the model, and therefore imposes a limit of 26 distinct gates on it. While 26 gates might seem sufficient in most cases, the number of layers to characterise can scale rapidly beyond that limit when crosstalk is considered. I would suggest using a more flexible labelling system.

@Pablovinas Pablovinas added the enhancement Request for a new feature or a change to an existing feature label Aug 28, 2024
@Pablovinas Pablovinas changed the title germsel.find_germs()' does not support composed operations.ComposedOp()' and is limited in large models. germsel.find_germs() does not support composed operations.ComposedOp() and is limited in large models. Aug 28, 2024
@Pablovinas Pablovinas changed the title germsel.find_germs() does not support composed operations.ComposedOp() and is limited in large models. germsel.find_germs() does not support operations.ComposedOp() and is limited in large models. Aug 28, 2024
@coreyostrove
Copy link
Contributor

Thanks for the report, @Pablovinas. Would you be a able to attach a minimal python script which reproduces the behavior you observed with germ selection for models containing ComposedOp?

@coreyostrove coreyostrove self-assigned this Aug 29, 2024
@Pablovinas
Copy link
Author

Hi @coreyostrove, thanks for your answer! I am not able to attach a script here, but you can find this minimal example .ipynb file I just uploaded on my GitHub profile. It provides some further detail.

@sserita sserita added this to the 0.9.13 milestone Sep 19, 2024
@sserita sserita modified the milestones: 0.9.13, 0.9.13.1 Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for a new feature or a change to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants