Comments (2)
First, for development related issue, please add a tag like: [Your Topic] in the very beginning of the title. And it would be better to use good first issue label for guideline issues.
IMHO, I still insist to have indexes stored in a block rather than gates. This is because the lack of inheriting in Julia, you cannot inherit members like Python, and this will cause multiple definitions of indexes. Try not to think about a Julia program like Python, and it's better to illustrate practical solution with a minimum working example (MWE) then you will find out this problem...
struct GateX
indexes
end
struct GateY
indexes
end
But it seems that packing separated indexes together would be a good solution for reduce memory in-contiguous and decrease cache missing.
from yao.jl.
As was discussed with @GiggleLiu , this is a rewrite of original blueprint folder to make it more trackable and clear. The Python
part is removed, mix python and julia up is quite weired... I will write another issue about parameter cache later. The details will be updated during the development.
Wave function & Register
A quantum register is an abstraction of quantum states processed by quantum circuits. It is an object that contains N
qubits, and can be reshaped, permuted.
mutable struct Register{T <: AbstractArray, N}
data::T
end
A register is actually a wave function in the form Psi(f, r, b)
, where
f
: concentrated dimensionsr
: remaining dimensionsb
: batched dimensions
Interfaces
Since, all types in julia is duck typed, we will firstly define this framework's structure by defining required functions.
Interface of Gate
type with:
apply!
: apply this gate-like object to a quantum register with certain parameters
-update!
: update this gate-like object (may contain parameters, like rotation gates) with some parameters
will be a subtype of AbstractGate
. Besides, there will be several properties (some functions with only one input):
size
: get the size of this gate-like object (how many qubits it will apply to)- TBD.
Interface of Block
The interface of block is the same with the interface of gates, which means blocks are a kind of gates. We will list extra interfaces in the future.
Types
Basic Gates
Basic gates are building material of circuits, e.g X, Y, Z, Rx, Ry, Rz, etc. It only use the interface of Gates.
Blocks
The following types will use the block interface.
Block
Block
are linear operators can be expanded on computational basis. It takes Block-List
as its member, thus can be viewed as a tree. It can use the interface of Gates. (which means a block can be treated as a gate)
Concentrator
A Concentrator will permute and expose the legs of a quantum register to other blocks/gates. For instance, given a register of 5 qubits and a Toffli gate on No. 1, 3, 5 qubit, by applying a concentrator of 1,3,5 to the register, No, 1, 3, 5 will be permuted and packed to be contiguous and exposed to next block/gate.
This is needs decision: use Focus or Concentrator as this block's name. I will use concentrator at the moment. Let's make this decision afterwards. However, I will list several reasons about why Concentrator
:
- concentrator means to pack a bunch of lines together in classical circuits
- the meaning of focus as a noun is about optics which is far from what we are doing here
LeafBlock
LeafBlock
is an abstract type for all blocks that do not have children. This may include:
- Algorithmic Blocks: Grover search, etc.
- Gate Blocks, e.g X, Y, etc.
Other Special Blocks
- Measure
- Entangler
from yao.jl.
Related Issues (20)
- Error mitigation HOT 1
- Select Issues/FR for QHack2023 HOT 3
- More efficient implementation of `two_qubit_depolarizing_channel()` HOT 7
- Using Yao.jl in my paper "Using the Julia framework to teach quantum entanglement" HOT 2
- Python Interface HOT 2
- QRNG HOT 1
- `dispatch!(circuit, angles)` fails when gates are created with `Irrational` angles HOT 3
- dispatch(Ry(0), :random) is not working correctly HOT 1
- H not working HOT 2
- How to run a random circuite in a batched way? HOT 4
- How to import Yao.jl into IBM Qiskit Python code?
- Quantum circuit from MPS HOT 5
- Can't calculate `von_neumann_entropy()` in gpu HOT 2
- Update compat for `BitBasis` to 0.9 HOT 1
- solving pde using quantum differentiable circuits
- Reduce the compiling time of the repeat constructor
- CUDA is listed as a wrong compat
- Undesired handling of complex values when the expectation of an observable has zero real part HOT 3
- Measure block acts differently on cpu registers and cuda registers
- Precompiling CuYao Error in Julia 1.10.4 HOT 1
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 yao.jl.