Comments (9)
QubitId is the fundamental type that gates care about, so it is very easy for others to implement their own. We don't have to do it for them.
I do think that QubitLoc should be moved into the google folder, and possibly renamed to XmonQubit.
from cirq.
from cirq.
As a prerequisite to #470, some extension of interfaces discussed here is required. What is required for placement code is:
- a method to retrieve all qubits,
- a method to resolve qubits connectivity,
- a method to provide qubits and connections costs,
- a method to provide information which interactions exclude which qubits from participating in other interactions.
- a method to lay out a List[LineQubit] on arbitrary device.
I started to think about creating GridQubit
, as discussed with @Strilanc, but all the methods I could think about fit GraphQubit
much better:
class GraphQubit(metaclass=abc.ABCMeta):
@abc.abstractmethod
def can_interact/is_adjacent(self, other: 'GraphQubit') -> bool:
pass
@abc.abstractmethod
def quality(self) -> float:
pass
@abc.abstractmethod
def interaction_quality(self, other: 'GraphQubit') -> float:
pass
@abc.abstractmethod
def interaction_qubits(self, other: 'GraphQubit') -> Set['GraphQubit']:
pass
class GraphDevice(metaclass=abc.ABCMeta):
@abc.abstractmethod
def qubits(self) -> Iterable['GraphQubit']:
@abc.abstractmethod
def neighbors_of(self, qubit: 'GraphQubit') -> Iterable['GraphQubit']:
@abc.abstractmethod
def map_to_line(self, qubits: List['GraphQubit']) -> Iterable['LineQubit']:
pass
What do you think about this?
from cirq.
@dabacon Do we need a graph qubit for the next milestone? My impression is that we don't; it's more abstract than what we need. At most we would need a GridQubit for 2d points, which is currently played by Xmon.
from cirq.
We're going to need to deal with more arbitrary adjacency for ion trap devices, so I think we will need something like this. One thing to note however is that I don't think we want to have objects like quality on the qubits themselves. In my mind the QubitId is the generic object, and these sub-classed Qubits are about laying out a structure for thinking about moving from one qubit to another, BUT that might not even correspond to the allowed interactions. So it's more like the abstract layout of the qubit, and putting things like quailty (of which gate? what quality?) is something that will come from elsewhere (essentialy it should be at least close to the hardware spec)
from cirq.
It seems more natural for adjacency and gate information to be part of the device rather than the qubit. Why not just give GraphDevice a graph attribute whose vertices can be generic QubitId
s?
from cirq.
@bryano Is this related to all of your not-yet-merged pull requests?
from cirq.
Yea, specifically #1181
from cirq.
Can this be closed?
from cirq.
Related Issues (20)
- Update produce-package.sh script HOT 2
- Automate stable release workflow HOT 1
- PauliSum reorders the qubits, possibly in a non-deterministic way HOT 2
- failing comparisons for noise channels
- Type errors in quantum engine api code
- Typo in docstring for GPI2 gate HOT 5
- External link returns 404 HOT 4
- Drop python 3.10 HOT 2
- update protobuf API calls so it does not have to be pinned to protobuf-4 HOT 1
- docs/hardware/pasqal/getting_started.ipynb fails to execute in Google Colab HOT 1
- Issue when commuting moments HOT 1
- Update cirq_rigetti to conform to the new mypy standard HOT 2
- cphase comparison with CZ failing after dependency update HOT 1
- Quantum shannon decomposition fails for QFT with non-unitary matrix error HOT 1
- `cirq.decompose_once` fails when called on `cirq.CZ` HOT 3
- Avoid pickling of cached values of `cached_method` decorated functions
- CI Pytest Windows fails because cirq_rigetti does not install
- dev docs suggest using "git remote -va" but -a is not a valid flag
- mypy fails with error about duplicate module named "setup.py"
- pylint fails with errors about bad-option-value HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cirq.