Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
19a7c2a
skeleton works
cicacica Jun 5, 2022
7c443ea
error works
cicacica Jun 8, 2022
8d32494
single sidelft works
cicacica Jun 8, 2022
c5e8451
crosstalk, passive noise sidelft
cicacica Jun 8, 2022
372def4
complicated passive noise
cicacica Jun 9, 2022
cd7c57b
works but needs manual eval
cicacica Jun 9, 2022
cfb087e
SiDellft ops seem to work
cicacica Jun 29, 2022
f5eeade
partial trace seems to work
cicacica Jul 4, 2022
877227b
SiDelft, shit result
cicacica Jul 4, 2022
064f814
partial trace bug found
cicacica Jul 4, 2022
c703d30
SiDelft: off resonant is so bad
cicacica Jul 4, 2022
5f140f1
SiliconDelft demo looks closer to experiments
cicacica Jul 13, 2022
c0e1b6e
sketch movement trapped ion
cicacica Jul 13, 2022
8a040c4
split and combine seems to work
cicacica Jul 13, 2022
8bdf19b
SiDelft: after fernando, final?
cicacica Jul 18, 2022
1c0cd51
SiDelft more polised, TIOx bit of pn
cicacica Jul 19, 2022
a3e6c40
TIONOX: indiv test, missing total test
cicacica Jul 19, 2022
d2926d3
prepare for the optimisation parameters
cicacica Jul 26, 2022
ded018e
GetNoisyForm[]
cicacica Aug 4, 2022
bf2de06
works calculating a cost
cicacica Aug 4, 2022
7b0c5e7
minmiisation on fixed ansatz
cicacica Aug 8, 2022
675d095
toy device pass cross check NG
cicacica Aug 10, 2022
653afaa
generate single- two- random qubit gates
cicacica Aug 10, 2022
0fea7be
connectivity by CombS
cicacica Aug 11, 2022
826d399
a bit of fix after meeting Joe
cicacica Aug 11, 2022
feba58b
toy recompile works simple
cicacica Aug 31, 2022
cc0c98f
more pruning
cicacica Sep 5, 2022
e115005
qftontoy
cicacica Sep 5, 2022
d49ff3c
sidelft use avg qubit freq
cicacica Sep 6, 2022
0c9d0c4
clean res run
Sep 7, 2022
335a9fc
Merge branch 'master' of /home/cica/repos/vqd
Sep 7, 2022
73d3aea
some run
cicacica Sep 8, 2022
da7ae5d
0.5% gate error
cicacica Sep 8, 2022
dc5a411
error 0.5% failed
Sep 13, 2022
3d72047
CJ missing pruning
cicacica Sep 14, 2022
f0ca906
fail 05
Sep 15, 2022
75d9285
1 simple removal
cicacica Sep 15, 2022
784c7b7
Merge branch 'toy05'
Sep 15, 2022
9b1eec4
merge
Sep 15, 2022
0e5074e
last point cjvqd
cicacica Sep 15, 2022
6a7ecef
cleanup fucked up merge
cicacica Sep 15, 2022
4b12e7a
gate synt
cicacica Sep 15, 2022
5918b41
fail clean
Sep 16, 2022
89e749e
finally converge
cicacica Sep 16, 2022
1c64a07
toy look good
cicacica Sep 16, 2022
70b4346
bit of correction
Sep 19, 2022
55b68db
Toy ends here; I'm bored
Sep 19, 2022
7b8a51d
Pretty plot on SiDelft
cicacica Sep 19, 2022
c33002c
SiDelft prepare to compile
cicacica Sep 19, 2022
ce40027
gate synthesis runs
Sep 22, 2022
04f9309
machine 2, pretty silicon
cicacica Sep 22, 2022
bd4de7f
with error mitig
cicacica Sep 22, 2022
2588d68
serialization works in trapped ions
cicacica Sep 30, 2022
266b9bf
trapped ion missing noise
cicacica Sep 30, 2022
e6f9fbf
trapped ions first model
cicacica Oct 4, 2022
dd168bd
Rydberg v1
cicacica Oct 6, 2022
ec08acc
wrapped Rydberg
cicacica Oct 8, 2022
df269cb
update sidelft
cicacica Oct 10, 2022
afa0742
denmat works good
cicacica Oct 12, 2022
1fe86c3
to try the noisy one
cicacica Oct 12, 2022
7ad1b9a
run some silicon, failed
Oct 15, 2022
b13cf28
silicon polish
cicacica Oct 15, 2022
fcf7858
more notes on Rydberg
cicacica Oct 18, 2022
efce09f
more notes on Rydberg
cicacica Oct 18, 2022
953172e
scaling the noise on sidelft
cicacica Oct 21, 2022
e0e53c8
prepare for noise qft4
cicacica Oct 21, 2022
c74fbb1
partial re-run on noisy circ
Oct 24, 2022
cd03df7
re-optimise params si
cicacica Oct 24, 2022
2444d8a
last run
Oct 24, 2022
4190c39
Merge branch 'master' of /home/oums1251/repos/VQD
Oct 24, 2022
fcb4f21
rerun result
cicacica Oct 25, 2022
ad0420b
wrap the error params
cicacica Oct 25, 2022
f83ad07
another trial, fail
Oct 25, 2022
cba563b
Merge branch 'master' of /home/cica/repos/vqd
Oct 25, 2022
d18bbb6
trapped ion before trying new circ sorting
cicacica Oct 28, 2022
f2e281f
entanglement fidelity with 2-qubit noise
cicacica Nov 2, 2022
af20185
compilation fail
Nov 2, 2022
55e7900
Merge branch 'master' of /home/cica/repos/vqd
Nov 2, 2022
de4e023
trapped ion, and better plot option for na
cicacica Nov 14, 2022
64ac60e
graph state rydberg
cicacica Nov 14, 2022
43dc85f
Merge branch 'master' of /home/cica/repos/vqd
Nov 14, 2022
3191435
debug BF
Nov 15, 2022
3d04a24
rydberg prepare
cicacica Nov 16, 2022
639c76b
fail rydberg
Nov 16, 2022
a3f8bca
strath prepare
cicacica Nov 17, 2022
4c38a73
strath
Nov 18, 2022
1b9e41d
fail synth si
Nov 18, 2022
12d015e
prepare counting strath
cicacica Nov 21, 2022
7f7fe02
better strath model
Nov 22, 2022
14cb57a
asym bitflip on strath
Nov 23, 2022
72d9038
rydberg simulations
Nov 30, 2022
59f9c03
small tweak
cicacica Nov 30, 2022
23bd5ee
BCS NVC
cicacica Nov 30, 2022
9b80fb0
NVC
Nov 30, 2022
3e6d5d2
prepare BCS
cicacica Dec 1, 2022
0ecb20f
matrixexp mean field
Dec 1, 2022
1a80beb
exact and mf works with U but not trotter
Dec 6, 2022
c59bed0
BCS trotter works, but order 4
Dec 6, 2022
ded1673
trotter works, conversio otw
Dec 6, 2022
26c43e0
search native nvc
Dec 7, 2022
a426021
rydberg plots
cicacica Dec 7, 2022
722e861
conversion untested
cicacica Dec 7, 2022
7a8e497
after simon's meet
Dec 8, 2022
fcfc24f
recomp CJ
cicacica Dec 12, 2022
f34d13c
prepare recompilation
cicacica Dec 13, 2022
323ed70
compile NVC
cicacica Dec 13, 2022
20de345
mid run NVC
Dec 18, 2022
14c6a1a
plotting stuff for project forum
cicacica Dec 18, 2022
6f626a9
propagator BCS all converge
Dec 19, 2022
2931935
CSS compilation
Dec 22, 2022
6741690
nvcdelft prep
cicacica Dec 19, 2022
487fdd3
savepoint: find pswap
cicacica Dec 22, 2022
26bba29
css recompile summary
cicacica Dec 26, 2022
81bb8d0
rerun for 100+ gates
Dec 27, 2022
6b12d9e
rerun with less accuracy goal
Dec 29, 2022
17192f5
bcs compile
cicacica Dec 27, 2022
fa39963
replace conditional rot into regular rot
cicacica Dec 29, 2022
dbc1b21
rerun wrong WTF
cicacica Dec 29, 2022
0479b33
bcscompile rerun
Dec 30, 2022
6ad0743
before adding new zone rule
cicacica Jan 27, 2023
33c2d85
SC passive noise
cicacica Jan 27, 2023
1f081f3
trapped ions 3 each
cicacica Jan 30, 2023
d5683eb
4-ions
cicacica Jan 30, 2023
572a2ad
tions almost final?
cicacica Feb 2, 2023
2cd0c89
Finally, passive noise works. Ugly but whatever.
cicacica Feb 6, 2023
ecb9bea
superconducting device basic test
cicacica Feb 6, 2023
df2e8b0
VQE on Hydrogen chains
cicacica Feb 14, 2023
ae5c0f6
Hamiltonians of H2 H3
cicacica Feb 14, 2023
6a24bf2
first run H2
Feb 15, 2023
5df4b52
vqe on SQC
Feb 15, 2023
5113de1
more hamiltonians
cicacica Feb 15, 2023
f1882be
cleanup hamiltonians
Feb 16, 2023
11921d3
VQE on SQC
Feb 16, 2023
42af39f
gatedur on sqc meas
cicacica Feb 16, 2023
4e36651
new run on H2 on SQC, original version
cicacica Feb 20, 2023
dd97dd5
prepare H3 run
cicacica Feb 20, 2023
dbe847b
savepoint: h20
Feb 21, 2023
089ff07
H2 VQEs
Feb 23, 2023
a2fc14f
gsh2
Feb 23, 2023
9131293
bit of H3 and others
Feb 23, 2023
a8d6dfa
run static
Feb 27, 2023
9ed38f3
table plots
cicacica Feb 23, 2023
e4232d9
sucker
cicacica Feb 23, 2023
8ca4217
a bit of strath
cicacica Feb 27, 2023
b37d2bd
-rerun the second time
cicacica Feb 27, 2023
4fa4469
update from source h2
Feb 27, 2023
ac26a44
Merge branch 'master' of /home/cica/repos/vqd
Feb 27, 2023
ff2931c
rerun H2
Mar 2, 2023
13eee7b
rerun for the second time
Mar 3, 2023
04e86ae
vqe on scq
Mar 6, 2023
f47b5c1
some plots in rydberg
cicacica Mar 2, 2023
1f323dc
parity measurement in Silicon Delft
cicacica Mar 11, 2023
1c4ee56
rydberg update
cicacica Mar 17, 2023
9dee112
rydberg graph state
cicacica Mar 17, 2023
4c57763
redo graph state a bit
cicacica Mar 19, 2023
24e9107
fail rerun on Rydberg GS
Mar 20, 2023
a1cb752
rerun steane7
cicacica Mar 21, 2023
376c13c
rerun steane 7
Mar 23, 2023
cbcc7e1
rerun steane7
cicacica Mar 23, 2023
a4c79f8
rydberg rerun
Mar 28, 2023
1b0aefe
Cleanup up until SQC
cicacica Apr 27, 2023
6eb4135
Cleanup source until SQC
cicacica Apr 27, 2023
27bd6ef
superconducting cleanup
cicacica May 2, 2023
20d0790
cleanup NVC-BCS
cicacica May 2, 2023
4c416e6
more BCS cleanup
cicacica May 2, 2023
fe43313
cleanup NVC
cicacica May 4, 2023
5611bb3
rydberg untested
cicacica May 6, 2023
b12763d
fix the drawing atom in rydberg
cicacica May 6, 2023
545d2f5
rydberg untested
cicacica May 7, 2023
3974b30
rerun 1d GS
May 10, 2023
426d4c2
reformat a bit
cicacica May 10, 2023
8e77f43
steane7
cicacica May 10, 2023
b111489
cleanup trapped ions
cicacica May 26, 2023
ae4cca4
steane7
May 27, 2023
547ed13
sidelft
cicacica May 27, 2023
06d8e4b
Merge branch 'master' of /home/cica/repos/vqd
May 27, 2023
afcb893
cleanup rydberg: waiting for the steane
cicacica May 28, 2023
2c56b91
clean clutter
cicacica May 28, 2023
1322264
rerun 2k
May 29, 2023
18d7a9c
resolve merge by keeping the fritz version
cicacica May 29, 2023
4bc4020
Merge remote-tracking branch 'fritz/master'
cicacica May 29, 2023
6f54664
update the result rydberg
cicacica May 29, 2023
0396449
remove sequences
cicacica Jun 2, 2023
c59405a
store fidvars of tions
cicacica Jun 4, 2023
81405df
fix the simultaneous initialisation on tions
cicacica Jun 4, 2023
a4b7c93
sort the naming of params
cicacica Jun 5, 2023
fbb49ff
some cleanup
cicacica Jun 5, 2023
f69834f
cut steane size and remove gate_synthesis
cicacica Jun 6, 2023
45bea49
init in sqc and cleanup
cicacica Jun 8, 2023
3550916
cleanup notebooks
cicacica Jun 13, 2023
c891bbc
remove buggy function
cicacica Jun 13, 2023
4d7e96e
Compatible with Mathematica 12
cicacica Jun 13, 2023
b4b3c77
typo and replace DeleteElements
cicacica Jun 13, 2023
4c671fa
remove outputs
cicacica Jun 13, 2023
c3d1185
readme, docs
cicacica Jun 13, 2023
8153c30
readme
cicacica Jun 13, 2023
f0bd9f5
Update README.md
cicacica Jun 13, 2023
611647f
restructure
cicacica Jun 28, 2023
b1819ef
add license
cicacica Jun 30, 2023
6aa262f
rerun everything
cicacica Jul 3, 2023
21b342b
add a banner
cicacica Jul 3, 2023
53bf4f9
add a bit of readme
cicacica Jul 3, 2023
09d933a
complete main readme
cicacica Jul 3, 2023
b423319
cleanup+readme
cicacica Jul 3, 2023
928bc7f
readme NVC
cicacica Jul 4, 2023
65c5cef
readme NVC rename
cicacica Jul 4, 2023
adcd1ab
Update README.md NVC
cicacica Jul 4, 2023
425b552
update nvc pics
cicacica Jul 4, 2023
e7755fc
update nvc pics
cicacica Jul 4, 2023
fe3db1b
change alpha nvc
cicacica Jul 4, 2023
9259b3a
change alpha nvc again
cicacica Jul 4, 2023
efb2a0b
neutral atom readme, some figures edit
cicacica Jul 4, 2023
c6cd54d
Update README.md on neutral atoms
cicacica Jul 4, 2023
458361d
Update README.md typos
cicacica Jul 4, 2023
fa22995
readme silicon
cicacica Jul 5, 2023
53e346e
Update README.md silicon
cicacica Jul 5, 2023
7d3c591
add TOC, SCQ readme
cicacica Jul 6, 2023
cd0beb4
readme ion trap
cicacica Jul 7, 2023
09db98e
Update README.md on ion trap
cicacica Jul 7, 2023
ad42b8e
Merge pull request #2 from QTechTheory/supports
cicacica Jul 7, 2023
d0518ee
nvc usage
cicacica Jul 17, 2023
580937e
try new lines
cicacica Jul 17, 2023
b5e0d2a
usage neutral atoms
cicacica Jul 17, 2023
05e10be
silicon readme
cicacica Jul 17, 2023
94c498e
usage scq, ion traps
cicacica Jul 17, 2023
faa2b63
Update README.md ion traps
cicacica Jul 17, 2023
0be4215
Supports (#3)
cicacica Jul 17, 2023
a6524a9
Update README.md
cicacica Aug 21, 2023
d6004d5
wrong assertion scq
cicacica Sep 20, 2023
238b34c
Supports (#5)
cicacica Sep 20, 2023
6dd42a5
fix t in off-res rabi silicon
cicacica Oct 13, 2023
357a98d
Supports (#6)
cicacica Oct 13, 2023
8ea3ced
adjust phase on the off-resonant rabi noise
cicacica Oct 20, 2023
3925e8b
Merge branch 'master' into supports
cicacica Oct 20, 2023
ae5250e
Supports (#7)
cicacica Oct 20, 2023
a6be37f
Supports (#7) (#8)
cicacica Feb 8, 2024
c5cc0b0
Neutral atom parallelisation, change GetQuregMatrix to GetQuregState
cicacica Feb 8, 2024
b0772d4
Merge pull request #9 from QTechTheory/supports
cicacica Feb 8, 2024
77c936d
NVCenterDelftN: explicit nitrogen spin
cicacica Apr 2, 2024
5d71e05
Merge pull request #10 from QTechTheory/devel
cicacica Apr 2, 2024
ed1231e
add overrotation on the 2-qubit gates in NVCN
cicacica Apr 3, 2024
95bb922
Merge pull request #11 from QTechTheory/devel
cicacica Apr 3, 2024
7279e10
emulation day
cicacica Apr 24, 2024
45c00f1
Coherence error first
cicacica Feb 17, 2025
a6d30ed
StdPassive noise switch on NV-centers
cicacica Feb 17, 2025
d59f266
add kraus-choi-superoperator conversion
cicacica Mar 14, 2025
0dd8613
add row shuffle
cicacica Mar 19, 2025
824fa7b
add row shuffle
cicacica Mar 19, 2025
c3105d8
bug in tensorize
cicacica Aug 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
quest_link*
gates_synthesis
others
sdbells
*.gif

11 changes: 11 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Released under MIT License

Copyright (c) 2013 Mark Otto.

Copyright (c) 2017 Andrew Fong.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3,085 changes: 3,085 additions & 0 deletions NVCenter/NVCenterDelft.nb

Large diffs are not rendered by default.

Binary file added NVCenter/NVCenterDelft.pdf
Binary file not shown.
1,265 changes: 1,265 additions & 0 deletions NVCenter/NVCenterDelftN.nb

Large diffs are not rendered by default.

119 changes: 119 additions & 0 deletions NVCenter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<div align="center">
<img src="../supplement/web/nvc.png" width="150" alt="Alt text">
</div>

# Nitrogen-vacancy center qubits

There is currently one virtual NV-center device, namely NV-center diamond that is inspired from devices in the University of Delft. This device is instantiated with command ``NVCenterDelft[]``.

**Table of contents**
1. [Characteristics](#characteristics)
2. [Native operations](#native-operations)
3. [Parameters and usage](#parameters-and-usage)

## Characteristics

NV-center has star-shaped connectivity, where the NV<sup>-</sup> electron spin is sitting in the center, surrounded by the nuclear spins <sup>13</sup>C &mdash; and may also involve <sup>14</sup>Nq spin.
We set the electron spin to be indexed 0 in the program. See the picture below, where q0 is the electron spin and the rest are nuclear spin. The green circle represents nitrogen spin if you want to use it; this is decided in the setting up the parameters, e.g., particular fidelities and coherence time.


<div align="center">
<img src="../supplement/web/conn_nvc.jpg" width="150" alt="Alt text">
</div>

Therefore, two-qubit gates operations can be done (directly) between the center spin to the surrounding spin.


## Native operations

Here are the operators defined in the virtual NV-center qubits, together with their commands.

- Direct initialisation is the NV electron spin only, can be performed anytime.
$$\mathtt{Init_0}$$
- Direct measurement is the NV electron spin only, can be performed anytime, and is projective measurement in the computational basis.
$$\mathtt{M_0}$$
- Single qubit gates are Pauli rotations that can be operated upon any qubit $q$.
$$\mathtt{Rx_q[\theta]}, \mathtt{Ry_q[\theta]}, \mathtt{Rz_q[\theta]}$$
- Two-qubit gates are conditional rotation between electron and nuclear spin $q>0$
$$\mathtt{CRx_{0,q}[\theta]}, \mathtt{CRy_{0,q}[\theta]}$$
where $$\mathtt{CR\sigma[\theta]}=\|0\rangle\langle0\|\otimes R\sigma(\theta)+\|1\rangle\langle1\|\otimes R\sigma(-\theta)$$
- Doing nothing; remember it will introduce passive noise
$$\mathtt{Wait_q[\Delta t]}$$

## Parameters and usage

The following configuration takes inspiration from devices at the University of Delft: a virtual NV-center contains six qubits without considering the nitrogen spin.

- Time unit is **second (s)**
- Frequency unit is **Hertz (Hz)**
- 0 is the index of NV<sup>-</sup> electron spin

The code below can be directly copied and executed.
```Mathematica
Options[NVCenterDelft] = {
QubitNum -> 6
,
(* T1 of each qubit *)
T1 -> <|0 -> 3600, 1 -> 60, 2 -> 60, 3 -> 60, 4 -> 60, 5 -> 60 |>
,
(* T2 of each qubit; we assume dynamical decoupling is actively applied *)
T2 -> <|0 -> 1.5, 1 -> 10, 2 -> 10, 3 -> 10, 4 -> 9, 5 -> 9|>
,
(* dipolar interaction among nuclear spins: cross-talk ZZ-coupling in order of a few Hz on passive noise *)
FreqWeakZZ -> 5
,
(* direct single rotation on Nuclear spin is done via RF, put electron in state -1 leave out the Rx Ry on nuclear spins ideally. *)
FreqSingleXY -> <|0 -> 15*10^6, 1 -> 500 , 2 -> 500, 3 -> 500, 4 -> 500, 5 -> 500|>
,
(* usually done virtually *)
FreqSingleZ -> <|0 -> 32*10^6, 1 -> 400*10^3, 2 -> 400*10^3, 3 -> 400*10^3, 4 -> 400*10^3, 5 -> 400*10^3|>
,
(* Frequency of CRot gate, conditional rotation done via dynamical decoupling or dd+RF. The gate is conditioned on electron spin state *)
FreqCRot -> <|1 -> 1.5*10^3, 2 -> 2.8*10^3, 3 -> 0.8*10^3, 4 -> 2*10^3 , 5 -> 2*10^3|>
,
(* Fidelity of CRot gate *)
FidCRot -> <|1 -> 0.98, 2 -> 0.98, 3 -> 0.98, 4 -> 0.98 , 5 -> 0.98|>
,
(* fidelity of x- and y- rotations on each qubit *)
FidSingleXY -> <| 0 -> 0.9995, 1 -> 0.995, 2 -> 0.995, 3 -> 0.99, 4 -> 0.99, 5 -> 0.99 |>
,
(* fidelity of z- rotations on each qubit *)
FidSingleZ -> <| 0 -> 0.9999, 1 -> 0.9999, 2 -> 0.99999, 3 -> 0.9999, 4 -> 0.999, 6 -> 0.99 |>
,
(* Error ratio of 1-qubit depolarising:dephasing of x- and y-rotations *)
EFSingleXY -> {0.75, 0.25}
,
(* Error ratio of 2-qubit depolarising:dephasing of CRot gate *)
EFCRot -> {0.9, 0.1}
,
(* initialization fidelity on the electron spin *)
FidInit -> 0.999
,
(* initialization duration on the electron spin *)
DurInit -> 2*10^-3
,
(* measurement fidelity on the electron spin *)
FidMeas -> 0.946
,
(* measurement duration on the electron spin *)
DurMeas -> 2*10^-5
};
```

In practice, dynamical decoupling is constantly applied to passive qubits to mitigate unwanted interaction. For instance, let ``circuit`` be a circuit comprises native operations. The following command obtain noisy version of running ``circuit`` on the virtual NV-center defined above.

```Mathematica
noisycircscheduled = InsertCircuitNoise[Serialize @ circuit, NVCenterDelft[], ReplaceAliases -> True];
noisycirc = Extractcircuit @ noisycircscheduled;
ApplyCircuit[rho, noisycirc]
```
First, variable ``noisycircscheduled`` contains noise-decorated ``circuit`` together with its schedule.
Command ``Serialize @ circuit`` imposes serial implementation,
turning every element into a set, i.e., maps a set {a,b,c,...} to {{a},{b},{c}...}.
Therefore, passive noise becomes more prevalent; however, given that dynamical decoupling is assumed,
the coherence values (T1 and T2) supposed to be high with this implementation.
Note that, option ``ReplaceAliases`` replaces gate aliases/custom gates into standard **QuESTlink** operations:
for instance ``Init`` gate here is defined as an amplitude damping.
Variable ``noisycirc`` contains noise-decorated ``circuit`` that is ready for simulation.
Second, the command ``ExtractCircuit[]`` basically removes the schedule information.
Finally, command ``ApplyCircuit`` operates ``noisycirc`` upon the density matrix ``rho``.
156 changes: 156 additions & 0 deletions NeutralAtom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<div align="center">
<img src="../supplement/web/rydberg.png" width="150" alt="Alt text">
</div>

# Neutral atoms

There is currently one virtual neutral atom device, namely Rydberg atom device that is inspired by devices in the University of Strathclyde and the University of Harvard. This device is instantiated with the command ``RydbergHub[]``.

**Table of contents**
1. [Characteristics](#characteristics)
2. [Native operations](#native-operations)
3. [Parameters and usage](#parameters-and-usage)

## Characteristics


Rydberg atoms/qubits are arranged inside a vacuum chamber. The atoms' configuration can be arbitrary for 2D and 3D geometries. Every atom is identical; they have the same noise characteristics and blockade radius. Qubits connectivity is fully connected, as multi-qubit gates operations can be done to any set of atoms as long as they lie within their overlapping radii. The user needs to reconfigure the atoms in order to fulfil the requirement; this is achieved by swapping and shifting the locations of the atoms.

Since atoms configuration is important, we provide a visualisation function ``PlotAtoms[]`` that will show the register/atoms configuration.

The following example generates a Rydberg device ``dev`` and plots its configuration.

```Mathematica
dev = RydbergHub[]
PlotAtoms[dev]
```
<img src="../supplement/web/na1.png" width="250" alt="Neutral atom default">

``PlotAtoms`` has options &mdash; with their default values &mdash; ``ShowBlockade->{}`` and ``ShowLossAtoms->False``; the first option shows the blockade radii of a set of atoms (empty by default) and the second option will show the last location of atoms that are lost to the environment (False by default). In addition, you can input the options from graphics as well to modify the visualisation style.

For instance, the following commands perform a circuit composing shifting location of atoms 5 and 7, followed by measurement on them. For instance, in this device, the atoms are lost to the environment with a high chance after measurement. Then, we plot the configuration of the register afterwards.
```Mathematica
circuit = {Subscript[ShiftLoc, 5, 7][{1, 0, 0}], Subscript[M,5], Subscript[M,7]}
InsertCircuitNoise[circuit, dev];
PlotAtoms[dev, ShowBlockade->{0,4}, ShowLossAtoms->True, LabelStyle->"Section", BaseStyle->Directive[14, FontFamily->"Times"]]
```
<img src="../supplement/web/na2.png" width="300" alt="Neutral atom default">

In the ``PlotAtoms[]`` command, option ``ShowBlockade->{0,4}`` shows blockade radii of atoms 0 and 4 which are overlapping, option ``ShowLossAtoms->True`` displays the last locations of atoms 5 and 7 before lost to the environment, indicated with grey colours, and the rest of options change style of the plots, i.e., font styles.


## Native operations

Below are the operators defined in the virtual Rydberg atom qubits, together with their commands.

- Initialisation can be done on any atom $q$, at anytime
$$\mathtt{Init_q}$$
- Measurement in the computation basis can be done anytime on any atom $q$; this process induces the atom lost to the environment.
$$\mathtt{M_q}$$
- Single-qubit gates comprise Pauli rotations, (frequently used) Hadamard, and arbitrary drive (single rotation ``SRot``)
$$\mathtt{Rx_q[\theta], Ry_q[\theta],Rz_q[\theta],H_q,SRot_q[\Phi, \Delta, dt]}$$,
where given that $\tilde\Omega=\sqrt{\Omega^2+\Delta^2}$, and $\Omega$ indicates the Rabi frequency,

$$\mathtt{SRot[\Phi,\Delta,dt]}=\begin{pmatrix}\cos(\frac{\tilde\Omega t}{2})-i \frac{\Delta}{\tilde\Omega}\sin(\frac{\tilde\Omega t}{2})&-i\frac{\Omega}{\tilde\Omega}\sin(\frac{\tilde\Omega t}{2})e^{i\phi} \\\\ -i\frac{\Omega}{\tilde\Omega}\sin(\frac{\tilde\Omega t}{2})e^{-i\phi} &\cos(\frac{\tilde\Omega t}{2}) +i\frac{\Delta}{\tilde\Omega}\sin(\frac{\tilde\Omega t}{2})\end{pmatrix}$$

- Two-qubit controlled-Z, given that atoms $\mathtt{q1}$ and $\mathtt{q2}$ lie within their overlapping radii.
$$\mathtt{CZ_{q1,q2}}$$
- Multi-qubit gates on atoms multiple-controlled Z, given that atoms $\mathtt{q1,q2,q3,...,qt}$ lie within their overlapping radii.
$$\mathtt{C_{q1,q2,q3,...}}[Z_{qt}]$$
- Multi-qubit gates on atoms one-control multiple-Z, given that atoms $\mathtt{q1,q2,q3,...,qc}$ lie within their overlapping radii.
$$\mathtt{C_{qc}}[Z_{q1,q2,q3,...}]$$
- Register reconfiguration: swap the location of atoms $\mathtt{q1}$ and $\mathtt{q2}$
$$\mathtt{SWAPLoc_{q1,q2}}$$
- Register reconfiguration: shift location of atoms $\mathtt{q1,q2,q3,...}$ by a vector $v$
$$\mathtt{ShiftLoc_{q1,q2,q3,...}}[v]$$
- Doing nothing; remember it will introduce passive noise
$$\mathtt{Wait_q[\Delta t]}$$

## Parameters and usage

The following configuration takes inspiration from a device at Harvard University: seven-qubit Rydberg atom device based on this [reference](https://doi.org/10.1038/s41586-022-04592-6), in the Steane code stabiliser measurement experiment.

- Time unit is **microseconds** ($\mu s$)
- Frequency unit is **megahertz (MHz)**
- Length/distance unit is **micrometer** ($\mu m$)

The code below can be directly copied and executed.

```Mathematica
Options[RydbergHub] = {
(* The total number of atoms/qubit*)
QubitNum -> 7
,
(*Physical location on each qubit described with a 2D- or 3D-vector*)
AtomLocations -> <|6 -> {0, 1}, 5-> {1, 1}, 2 -> {2, 1}, 1 -> {4, 1}, 4 -> {2, 0}, 0 -> {4, 0}, 3 -> {5, 0}|>
,
(* It's presumed that T2* has been echoed out to T2 *)
T2 -> 1.5*10^6
,
(* The lifetime of vacuum chamber, where it affects the T1 time, T1=Tvac/N, where N=number of atoms *)
VacLifeTime -> 48*10^6
,
(* Rabi frequency of the atoms. We assume the duration of multi-qubit gates is as long as 4$\pi$ pulse of single-qubit gates *)
RabiFreq -> 1
,
(* Asymmetric bit-flip error probability; the error is acquired during single qubit operation *)
ProbBFRot -> <|10 -> 0.001, 01 -> 0.03|>
,
(* This will be the unit of the lattice and coordinates *)
UnitLattice -> 3
,
(* blockade radius of each atom *)
BlockadeRadius -> 1
,
(* Leakage probability during initialisation process *)
ProbLeakInit -> 0.001
,
(* Leakage probability during initialisation process *)
DurInit -> 5*10^5
,
(* Duration of moving atoms; we assume SWAPLoc and ShiftLoc take this amount of time *)
DurMove -> 100
,
(* The factor that estimates accelerated dephasing due to moving the atoms. Ideally, it is calculated from the distance and speed. *)
HeatFactor -> 10
,
(* Fidelity of qubit readout *)
FidMeas -> 0.975
,
(* Duration of readout *)
DurMeas -> 10
,
(* The increasing probability of atom loss on each measurement. The value keeps increasing until being initialised *)
ProbLossMeas -> 0.0001
,
(* leak probability of implementing multi-qubit gates *)
ProbLeakCZ -> <|01 -> 0.01, 11 -> 0.0001|>
};
```
To allow efficient gates implementation that also reflects to what happen in practice, we provide gates arrangement command
``CircRydbergHub[]`` with option to implement parallel (``CircRydbergHub[circuit, device, Parallel -> True]``) or serial implementation.
(``CircRydbergHub[circuit, device, Parallel -> False]``).

Parallelisation in neutral atoms is atomic configuration-dependent, where concurrent operations can be performed if
the corresponding atoms operated upon do not have their blockade radii overlapped.
This means, if two atoms have their blockade radii overlapping, then parallel gates cannot be performed upon them.
On the other hand, serial implementation imposing gates to be performed one at a time, but initialisations are done simultaneously.
This reflects the initialisation process in practice comprises loading and rearranging the atoms.

Here is an example of implementing a ``circuit`` in parallel fashion, on a virtual netural atoms. Note that ``circuit`` contains legitimate operations
taking into account requirement on the atomic configurations, e.g., two-qubit gates are legit to atoms within their overlapping blockade radii.

```Mathematica
mydev = RydbergHub[];
noisycircscheduled = InsertCircuitNoise[CircRydbergHub[circuit, mydev, Parallel -> True], mydev, ReplaceAliases -> True];
noisycirc = ExtractCircuit @ noisycircscheduled;
ApplyCircuit[rho, noisycirc];
```
First, ``mydev`` contains an instance of ``RydbergHub[]``.
Second, ``noisycircscheduled`` contains noise-decorated of parallel implementation of ``circuit``.
Note that, ``InsertCircuitNoise`` command modifies ``mydev``; for instance, the arrangement of atoms, loss probabilities
due to measurements are updated and stored in ``mydev``.
Parallel arrangement is taken care by command ``CircRydberghub[Parallel -> True]``,
which takes into account register reconfiguration operations in ``circuit``.
Third, ``noisycirc`` contains the noise-decorated ``circuit`` without schedule information.
Finally, ``ApplyCircuit`` command operates the noisy circuit ``noisycirc`` to a density of states ``rho``.
Loading