dde / qqcs

Quick Quantum Circuit Simulation
Other
1 stars 5 forks source link

Design new syntax to declare circuit lines to be divided into separate registers. #15

Open dde opened 3 years ago

dde commented 3 years ago

Currently, circuit lines are effectively a single quantum register. This means that a 10-qubit circuit will require matrices of size 2 to the 10th power. Although the system handles these, computation can take time, even with the sparse matrix implementation. Registers will help curtail the exponential impact of large circuits, leading to more efficient computation. A register declaration can be either a separate syntactical entity or a prefix to the current syntax. Registers should support names and circuit line ranges. Also a register declaration should allow bak references to previously named registers so that a circuit could incorporate results from a previous circuit computation.

RamAIbot commented 3 years ago

Hi, Can you please provide any example on how to start?

dde commented 3 years ago

Currently, the quantum circuit is in effect a single register. The operand of every gate is the (implied) full circuit. If you have a 10-qubit circuit, each gate's suffixes position that gate within the full circuit. Registers would divide the full circuit into subsets of circuit lines. If one stopped there and did not make further syntax changes, then the current syntax would imply the register usage. I.e., if reg A was lines 0-4 and reg B was line 5-9, then a gate that referenced only lines in 5-9 need only be internally represented by a matrix 32x32, not 1024x1024. Only cross-register references would have to be large matrices. Further syntax changes could be made to augment gates with register operands, which might be more readable, but more verbose. The current syntax is specified at the end of README.md, and can be found in the file src/buildtools/z-qdesk.txt. The code in buildtools is a compiler-compiler which reads the syntax description and generates the compiler for the notation (qdesk_compiler.js). The syntax must conform to an LL(1) language. The interpreter is qdesk_interpret.js