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

TComplexity not working for several bloqs #1225

Closed
mstechly opened this issue Jul 31, 2024 · 3 comments
Closed

TComplexity not working for several bloqs #1225

mstechly opened this issue Jul 31, 2024 · 3 comments

Comments

@mstechly
Copy link
Contributor

While working on #1194 , I noticed that several bloqs throw the following exception:

E           TypeError: couldn't compute TComplexity of:
E           type: <class 'qualtran.bloqs.basic_gates.x_basis.MinusEffect'>
E           value: MinusEffect

Here's a list of these bloqs:

  • MinusState
  • MinusEffect
  • PlusEffect
  • PlusState
  • OneEffect
  • OneState
  • ZeroEffect
  • ZeroState
  • Product
  • TopLeftRowColumnOracle
  • C[TwoBitSwap]
  • ModSub
  • ECAddR
  • ECWindowAddR
  • MeasureQFT

Not sure if that's an expected behaviour or not, perhaps throwing NotImplementedError or something even more specific would be more informative.

FYI apart from that I got a couple of other errors. They seem mostly associated with symbolics, such as: ValueError: Split cannot have a symbolic data type. or TypeError: cirq.unitary failed. Value doesn't have a (non-parameterized) unitary effect..

@mpharrigan
Copy link
Collaborator

Thanks, tracking in #835 (comment) as well.

I'll treat this as a sub-bug of #735

@mpharrigan
Copy link
Collaborator

In the mean time, you should except these errors

@mpharrigan mpharrigan added this to the v1.0 milestone Aug 23, 2024
@mpharrigan
Copy link
Collaborator

The new list is

scaled_chebyshev_poly_even DecomposeTypeError
product_block_encoding_symb DecomposeTypeError
ec_add DecomposeNotImplementedError
ec_add_r DecomposeNotImplementedError
ec_add_r_small DecomposeNotImplementedError
ec_window_add DecomposeNotImplementedError
ec_pe DecomposeNotImplementedError
ec_pe_small DecomposeNotImplementedError
ecc DecomposeNotImplementedError

Reminder:

  • DecomposeNotImplementedError means that we can't compute the cost because the bloq doesn't have a decomposition annotated and it isn't an atomic/leaf bloq. Bloqs aren't obligated to give their decomposition
  • DecomposeTypeError means you're trying to decompose something that ought not be decomposed: something with symbolic parameters or an atomic/leaf bloq that the gate counting code doesn't know what to do with.

Other exception types would be a bug; but I think we've got all of those out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants