Conversation
- introduce modality - inherit backend from numpy backend - support matrices operation - returns result as measurement
# Conflicts: # src/qibo/backends/__init__.py
for more information, see https://pre-commit.ci
| def BS(self, theta): | ||
| cos = np.cos(theta / 2.0) + 0j | ||
| isin = -1j * np.sin(theta / 2.0) | ||
| return self._cast([[cos, isin], [isin, cos]], dtype=self.dtype) |
There was a problem hiding this comment.
Like the Hadamard gate that is already defined in qibo, this gate seems to be the same as the gates.RX.
There was a problem hiding this comment.
Just in case: whenever you'd like to run tests, you will need to generate a synced lockfile.
You can do it by running poetry lock (pure lockfile generation) or poetry update (lockfile generate and Poetry environment update, i.e. installing the lockfile specified dependencies, removing outdated ones).
Hi @ericbrts, that sounds like a great contribution! I started reading your code (and apparently @renatomello as well), so I may leave some comments to better understand the proposed additions.
Understood.
In this sense, because of my personal ignorance regarding LOQC, I may benefit from a quick intro. Do you have any source to recommend for a quick overview of basic concepts?
Yes, you may be interested to know that, almost one year ago, we were actually reconsidering the Qibo primitives. "Accidentally" in this same direction. This project is not a priority, for now. But, if it will result that we need some intensive extension of the current Qibo circuit API, we may explore again to do that in that context (since we have other valid motivations to invest in it). |
|
Hello all, hello @alecandido
One way you could see the difference in 1-qubit gates between gate based and photonics, is that you can think of one photon in two optical modes representing one qubit (it's the positional or "dual rail" encoding, which is one of the most straight forward encoding). |1,0>photonics would correspond to |0>qubit and |0,1>photonics to |1>qubit. If you have some time, you could have a look to this part of the Perceval tutorial: However, it's not photonics goal to map logical gates one-to-one and, in linear optics, multiple photons could interact in a so called "one-qubit" gate. Best, |
Great, thanks for the advice! @ericbrts I will make sure to check the tutorial before getting back with further comments. However, if linear optics has "further dimensions", wrt qubits operations, such that you can not bijectively map the first one onto the second, then maybe better to think about something different from stuffing both in the same representation. In any case, if you already have a target in mind (another instance of an interface spanning linear optics and qubits Hilbert spaces), or a clear plan on your side, feel free to propose what do you believe to be best. It's very interesting to extend Qibo beyond its current scope, and integrate it Perceval. But, well, that certainly requires some meditation first :) |
Hi Qibo team,
Here's a proposal for linear optics quantum computing integration in Qibo, that I wrote along with Jean Senellart.
With this implementation, one would be able to:
A usage example was written in the notebook located in scripts/playground.ipynb.
This pull request is a proof of concept and is not ready to merge.
Adding a whole modality to Qibo is a big work and will probably require discussions and your guidance.
For instance, parts of the proposed code is not clean. We wanted to use the H gate both in the gate-based and photonics world. But as the qubits/wires a gate acts on are hold by the gate instance, as its internal data, we're facing the issue that H is plugged on 1 wire (qubit) in gate based, and on 2 wires (optical modes) in photonics.
One way of solving this fundamental issue could be to externalize the gate positioning data from the gate instance. The circuit instance would know where each component is placed, but not the components themselves. That way, a H gate would have 1 connection in gate-based modality circuits and 2 in photonics modality.
Also, I've implemented a short class that's able to send a computation order on Quandela Cloud. Studying Qibo, I feel like it would find its place in qibo-cloud-backends. However, for readability sake, I chose to write the code directly in qibo for now.
Thanks,
Best wishes,
Eric