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

Consider adding StateVectorMixin to ProductState, _NamedOneQubitState #3517

Closed
balopat opened this issue Nov 20, 2020 · 5 comments
Closed

Consider adding StateVectorMixin to ProductState, _NamedOneQubitState #3517

balopat opened this issue Nov 20, 2020 · 5 comments
Labels
area/product-states kind/feature-request Describes new functionality status/stale This has been closed due to inactivity for an extended period of time. triage/wont-fix Decided against going forward with this

Comments

@balopat
Copy link
Contributor

balopat commented Nov 20, 2020

StateVectorMixin provides a couple of useful features on the state vector itself. ProductState and _NamedOneQubitState and its subclasses could benefit from it.

cc @mpharrigan wdyt?

@mpharrigan
Copy link
Collaborator

mpharrigan commented Nov 20, 2020

The mixin uses qubit_map which is designed for a vector (aka ndarray) based representation so you can map qubits to indices in a contiguous array. ProductState is like a dictionary (so this isn't applicable) and NamedOneQubitState only has one qubit (per its name (it's also named per its name)). The mixin also has qid_shape which similarly doesn't make as much sense for ProductState.

There's a couple of helpful methods, however, that only require the .state_vector() method to be implemented, which the classes do implement

Is StateVectorMixin used anywhere? Either "no" or my pycharm is broken :) my pycharm was/is broken

@balopat balopat added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Nov 30, 2020
@vtomole vtomole added triage/wont-fix Decided against going forward with this and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque labels Oct 13, 2021
@vtomole
Copy link
Collaborator

vtomole commented Oct 13, 2021

According to @viathor , this points to a more general problem of Cirq not having a philosophy with which to make technical decisions when it come to state representation. He'll file an issue about this.

@viathor
Copy link
Collaborator

viathor commented Oct 15, 2021

Filed #4582 for discussion. Keeping this issue open for now, but if we decide to consolidate our representations of quantum states then it will become moot and should be closed.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

@github-actions
Copy link

Issue closed due to inactivity.

@mhucka mhucka added T status/stale This has been closed due to inactivity for an extended period of time. and removed triage/stale labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/product-states kind/feature-request Describes new functionality status/stale This has been closed due to inactivity for an extended period of time. triage/wont-fix Decided against going forward with this
Projects
None yet
Development

No branches or pull requests

5 participants