Skip to content

Update type annotation of Linspace and Points #6830

Closed
@NoureldinYosri

Description

@NoureldinYosri

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/healthFor CI/testing/release process/refactoring/technical debt itemsno QC knowledge neededWant to contribute to Cirq, but don't know quantum computing? This issue is for you.status/rfc-neededThis needs an RFC document.triage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked ontriage/needs-feasibility[Feature requests] Needs design work to prove feasibility before accepting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions