Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Refactor Microsoft.Quantum.Preparation for consistency and to use style guide. #211

@cgranade

Description

@cgranade

Describe the bug
The current Microsoft.Quantum.Preparation namespace, which provides functions and operations for preparing quantum registers in a variety of different states, currently suffers from a number of different usability and consistency issues:

  • The name of the PrepareQubit operation does not accurately reflect what it does (namely, that it prepares the positive eigenstate of a single-qubit Pauli operator). (originally reported by @tcNickolas)
  • API documentation comments are inaccurate and lack examples (the latter as noted in Provide more examples in API documentation comments #113)
  • API documentation comments use mathematical notation in summaries, breaking hover information in LSP clients (e.g.: VS Code and VS 2019).
  • API documentation comments refer to "returning unitaries" rather than returning operations.
  • Private callables indicated by trailing rather than leading underscores; this should go away with adapting to use Access modifiers for callables and types qsharp-compiler#259, but it would be good to be consistent in the meantime.
  • The StatePreparationComplexCoefficients and StatePreparationPositiveCoefficients functions are identical up to the type of their expected inputs, rather than using type suffixes.
  • StatePreparationPositiveCoefficients can be readily generalized to allow negative coefficients as well.
  • The output type of QuantumROM is confusing, and can be clarified by defining a new UDT; this does present additional API documentation concerns, however, given Allow documenting named items of UDTs qsharp-compiler#113.
  • The name QuantumROM preferences the implementation above the thing being implemented, and should be renamed accordingly.

Metadata

Metadata

Assignees

Labels

Kind-BugSomething isn't workingResolution-DoneIssue closed because work item completed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions