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

Update type annotation of Linspace and Points #6830

Open
NoureldinYosri opened this issue Dec 10, 2024 · 0 comments
Open

Update type annotation of Linspace and Points #6830

NoureldinYosri opened this issue Dec 10, 2024 · 0 comments
Labels
kind/health For CI/testing/release process/refactoring/technical debt items no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. status/needs-rfc triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/needs-feasibility [Feature requests] Needs design work to prove feasibility before accepting

Comments

@NoureldinYosri
Copy link
Collaborator

Description of the issue
Linspace and Points have type annotations that use only floats ... however there is nothing in their operations that doesn't allow using other datatypes that as long as they support arithmetic operations. for example the following example is valid and works

In [1]: import cirq

In [2]: import tunits

In [3]: for t in cirq.Linspace('t', tunits.ns, 3*tunits.ns, 10):
   ...:     print(t)
   ...: 
cirq.ParamResolver({'t': Time(1.0, 'ns')})
cirq.ParamResolver({'t': Time(1.222222222222222, 'ns')})
cirq.ParamResolver({'t': Time(1.4444444444444444, 'ns')})
cirq.ParamResolver({'t': Time(1.6666666666666667, 'ns')})
cirq.ParamResolver({'t': Time(1.8888888888888888, 'ns')})
cirq.ParamResolver({'t': Time(2.111111111111111, 'ns')})
cirq.ParamResolver({'t': Time(2.3333333333333335, 'ns')})
cirq.ParamResolver({'t': Time(2.555555555555556, 'ns')})
cirq.ParamResolver({'t': Time(2.7777777777777777, 'ns')})
cirq.ParamResolver({'t': Time(3.0, 'ns')})

functionally the sweeps work but the type annotations need to be updated to reflect that

related to #6829

@NoureldinYosri NoureldinYosri added kind/health For CI/testing/release process/refactoring/technical debt items triage/discuss Needs decision / discussion, bring these up during Cirq Cynque good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/needs-feasibility [Feature requests] Needs design work to prove feasibility before accepting status/needs-rfc and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque good first issue This issue can be resolved by someone who is not familiar with the codebase. A good starting issue. labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/health For CI/testing/release process/refactoring/technical debt items no QC knowledge needed Want to contribute to Cirq, but don't know quantum computing? This issue is for you. status/needs-rfc triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/needs-feasibility [Feature requests] Needs design work to prove feasibility before accepting
Projects
None yet
Development

No branches or pull requests

1 participant