Skip to content

simplifying qubit.new #508

@Roger-luo

Description

@Roger-luo
  • add a new statement qubit.NewQubit now only allocates a single qubit
  • create a stdlib function qubit.new(int) that allocates IList[Qubit, N]
  • create a wrapper qubit.new_qubit() that creates a single new qubit.

Caveat:

We don't have dependent types so when %n is non-constant at compile-time in qubit.new(%n) we won't be able to infer a variable length as type variable. This is prob ok for now because we don't have dynamic allocated qubits (or just a few ancilla that does not require a list)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions