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

UINTMAX is hard-coded as 2^32 - 1 #165

Closed
qartik opened this issue Apr 10, 2024 · 4 comments · Fixed by #190
Closed

UINTMAX is hard-coded as 2^32 - 1 #165

qartik opened this issue Apr 10, 2024 · 4 comments · Fixed by #190
Labels
enhancement New feature or request

Comments

@qartik
Copy link
Member

qartik commented Apr 10, 2024

UINTMAX is hard-coded as $2^{32} - 1$, but if we have non-32-bit registers we'd want a different value. In pytket's QASM converters there is a maxwidth parameter that can be used to set this value (defaulting to 32). Could something similar be done here?

Originally posted by @cqc-alec in #162 (comment)

@qartik qartik changed the title UINTMAX is hard-coded as $2^{32} - 1$, but if we have non-32-bit registers we'd want a different value. In pytket's QASM converters there is a maxwidth parameter that can be used to set this value (defaulting to 32). Could something similar be done here? UINTMAX is hard-coded as $2^{32} - 1$ Apr 10, 2024
@qartik qartik changed the title UINTMAX is hard-coded as $2^{32} - 1$ UINTMAX is hard-coded as 2^32 - 1 Apr 10, 2024
@qartik qartik added the bug Something isn't working label Apr 10, 2024
@qartik
Copy link
Member Author

qartik commented Apr 29, 2024

Hi @cqc-alec, is it possible to obtain the maxwidth parameter from a Circuit, let's say if the program's source is not QASM?

I don't currently see a way to remove this hard coded value without being able to uniformly access it for all programs.

In any case, for QASM programs the value is correct.

@cqc-alec
Copy link
Collaborator

Hi @cqc-alec, is it possible to obtain the maxwidth parameter from a Circuit, let's say if the program's source is not QASM?

I don't currently see a way to remove this hard coded value without being able to uniformly access it for all programs.

In any case, for QASM programs the value is correct.

No it's not possible to obtain from a pytket Circuit, because it's a lower-level property -- a Circuit can have arbitrarily-sized classical "registers" (in scare quotes because it doesn't really have registers at all, just bits with labels). So this parameter depends on knowledge of the backend.

@qartik
Copy link
Member Author

qartik commented Apr 30, 2024

In that case, I will let the value as is. We can come back to it when the backend changes.

@qartik qartik closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@qartik
Copy link
Member Author

qartik commented May 1, 2024

Reopening to make maxwidth a parameter to pytket-phir as discussed.

@qartik qartik reopened this May 1, 2024
@qartik qartik added enhancement New feature or request and removed bug Something isn't working labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants