Skip to content

Commit

Permalink
add statefidelity sampling for arbitrary state in MC sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
EigenSolver committed Jul 6, 2024
1 parent 5903b38 commit 348d229
Show file tree
Hide file tree
Showing 11 changed files with 904 additions and 846 deletions.
44 changes: 22 additions & 22 deletions docs/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
H_{noise}(t)=g \mu_B \sum_j \left[B_0(x^c_j)+\tilde{B}(x^c_{j},t)\right] S_j^z
```

We assume the electrons are adiabatically transported in moving-wave potential with their wave-functions well localized at $x_j^c$. Then the effective magnetic noise $\tilde{B}(x_j^c, t)$ can be modeled by a Gaussian random field.
We assume the electrons are adiabatically transported in moving-wave potential with their wave functions well localized at $x_j^c$. Then, the effective magnetic noise $\tilde{B}(x_j^c, t)$ can be modeled by a Gaussian random field.

In the case of pure dephasing, the system dynamics cna be explicitly writen out.
In the case of pure dephasing, the system dynamics can be explicitly written out.

```math
U(t)=\exp(-\frac{i}{\hbar} \int_0^t H_{noise}(\tau)\mathrm{d} \tau)
Expand All @@ -20,7 +20,7 @@ If we label a realization of the random process by $k$, then the pure dephasing
=\sum_k E_k \rho E_k^\dagger, \quad E_k= U_k /\sqrt{M}
```

The pure dephasing of such a system can be analytically solved and efficiently obtained via a matrix of dephasing factors. While more general system dynamics involving other interactions can be numerically solved by Monte-Carlo sampling.
The pure dephasing of such a system can be analytically solved and efficiently obtained via a matrix of dephasing factors, while more general system dynamics involving other interactions can be numerically solved by Monte-Carlo sampling.

```math
\mathcal{H}(t)=H_{noise}(t)+H_{int}(t)
Expand All @@ -32,29 +32,29 @@ Import the package.
using SpinShuttling
using Plots
```
We first define an 2D Ornstein-Uhlenbeck field, specified by three parameters.
We first define a 2D Ornstein-Uhlenbeck field, specified by three parameters.
```@example quickstart
κₜ=1/20; # inverse correlation time
κₓ=1/0.1; # inverse correlation length
σ = 1; # noise strength
B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ); # mean is zero
nothing
```
Specify a trajectory `(t,x(t))` on the 2D plane, in this example case it's just a line.
Specify a trajectory `(t,x(t))` on the 2D plane; in this example case, it's just a line.
```@example quickstart
t=range(1,20,200); # time step
v=2; #velocity
P=collect(zip(t, v.*t));
```
A Gaussian random process (random function) can be obtained by projecting the Gaussian random field along the time-space array `P`. Then we can use `R()` to invoke the process and generating a random time series.
A Gaussian random process (random function) can be obtained by projecting the Gaussian random field along the time-space array `P`. Then, we can use `R()` to invoke the process and generate a random time series.
```@example quickstart
R=RandomFunction(P, B)
plot(t, R(), xlabel="t", ylabel="B(t)", size=(400,300))
```


## Shuttling of a single spin
We can follow the above approach to define a single spin shuttling model.
We can follow the above approach to define a single-spin shuttling model.
```@example quickstart
σ = sqrt(2) / 20; # variance of the process
κₜ=1/20; # temporal correlation
Expand All @@ -65,23 +65,23 @@ nothing
```

Consider the shuttling of a single spin at constant velocity `v`.
We need to specify the initial state, travelling time `T` and length `L=v*T`,
and the stochastic noise expreienced by the spin qubit.
We need to specify the initial state, traveling time `T`, and length `L=v*T`,
and the stochastic noise experienced by the spin qubit.
```@example quickstart
T=400; # total time
L=10; # shuttling length
v=L/T;
```
The package provided a simple encapsulation for the single spin shuttling, namely
by `OneSpinModel`.
We need to specify the discretization size and monte-carlo size to create a model.
We must specify the discretization and Monte-Carlo sizes to create a model.
```@example quickstart
M = 10000; # monte carlo sampling size
N=301; # discretization size
model=OneSpinModel(T,L,N,B)
println(model)
```
This provides us an overview of the model. It's a single spin shuttling problem with initial state `Ψ₀` and an Ornstein-Uhlenbeck noise. The total time of simulation is `T`, which is discretized into `N` steps.
The `println` function provides us with an overview of the model. It's a single spin shuttling problem with the initial state `Ψ₀` and an Ornstein-Uhlenbeck noise. The total time of simulation is `T`, which is discretized into `N` steps.

The effective noise of this spin qubit is completely characterized by its covariance matrix.
```@example quickstart
Expand All @@ -92,11 +92,11 @@ right_margin=5Plots.mm)
```
The state fidelity after such a quantum process can be obtained using numerical integration of the covariance matrix.
```@example quickstart
f1=averagefidelity(model); # direct integration
f1=statefidelity(model); # direct integration
f2, f2_err=sampling(model, fidelity, M); # Monte-Carlo sampling
f2, f2_err=sampling(model, statefidelity, M); # Monte-Carlo sampling
```
For the single spin shuttling at constant velocity, analytical solution is also available.
An analytical solution is also available for single-spin shuttling at a constant velocity.
```@example quickstart
f3=1/2*(1+W(T,L,B));
```
Expand All @@ -109,15 +109,15 @@ println("MC:", f2)
println("TH:", f3)
```

The pure dephasing channel is computationaly simple, and can be represented by a dephasing matrix $w$, such that the final density state after the channel is given by $\mathcal{E}(\rho)=w \odot\rho$. Here $\odot$ is a element-wise Hadmard product.
The pure dephasing channel is computationally simple and can be represented by a dephasing matrix $w$, such that the final density state after the channel is given by $\mathcal{E}(\rho)=w \odot\rho$. Here $\odot$ is an element-wise Hadmard product.
```@example quickstart
Ψ= model.Ψ
ρ=Ψ*Ψ'
w=dephasingmatrix(model)
ρt=w.*ρ
```

We can check that the fidelity between the initial and final state is consistent with results above.
We can check that the fidelity between the initial and final state is consistent with the results above.
```@example quickstart
f=(Ψ'*ρt*Ψ)
```
Expand All @@ -128,9 +128,9 @@ The general abstraction on such a problem is given by the data type `ShuttlingMo
```julia
ShuttlingModel(n, Ψ, T, N, B, X, R)
```
User can freely define a n-qubit system with arbitrary initial state. Here, `X=[x1,x2...]` is an array of function, containing spin trajectories $x_i(t)$. `R` is a random function constructed from the specific noise process.
Users can freely define an n-qubit system with an arbitrary initial state. Here, `X=[x1,x2...]` is an array of functions, containing spin trajectories $x_i(t)$. `R` is a random function constructed from the specific noise process.

One more example is the shuttling of two spin pairs. We can define such a two spin system.
One more example is the shuttling of two spin pairs. We can define such a two-spin system.
```@example quickstart
L=10; σ =sqrt(2)/20; M=5000; N=501; T1=100; T0=25; κₜ=1/20; κₓ=1/0.1;
B=OrnsteinUhlenbeckField(0,[κₜ,κₓ],σ)
Expand All @@ -139,7 +139,7 @@ println(model)
```

The system is initialized in the Bell state $\ket{\Psi^-}$.
The model encapsulated a model of two spin shuttled in a sequential manner, as we can see from the two trajectories `x1(t)` and `x2(t)`. One spin goes first and then follows another, with waiting time `T0`. This is modeled by the piece-wise linear trajectories.
The model encapsulated a model of two spins shuttled in a sequential manner, as we can see from the two trajectories `x1(t)` and `x2(t)`. One spin goes first and then follows another, with a waiting time of `T0`. This is modeled by the piece-wise linear trajectories.
We can see some quite interesting covariance from such a system.
```@example quickstart
plot(model.R.P[1:N,1], label="x1(t)",
Expand All @@ -156,10 +156,10 @@ xlabel="t1", ylabel="t2", dpi=300,
right_margin=5Plots.mm)
```

We can check that the dephasing of the system and calculate its fidelity as before.
We can check the dephasing of the system and calculate its fidelity as before.
```@example quickstart
f1=averagefidelity(model)
f2, f2_err=sampling(model, fidelity, M)
f1=statefidelity(model)
f2, f2_err=sampling(model, statefidelity, M)
f3=1/2*(1+W(T0, T1, L,B))
println("NI:", f1)
Expand Down
10 changes: 5 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*Simulate the multiple-spin shuttling problem under correlated stochastic noise.*

## Installation
`SpinShuttling.jl` can be installed by cloning the repository from github.
`SpinShuttling.jl` can be installed by cloning the repository from GitHub.
```shell
git clone https://github.com/EigenSolver/SpinShuttling.jl.git
```
Go to the directory of the project in terminal.
Go to the directory of the project in the terminal.
```shell
cd ./SpinShuttling.jl
```
Expand All @@ -17,16 +17,16 @@ pkg> add .
```

## What does this package do
This package provides a set of abstractions and numericals tools to simulating dynamics of multi-spin system under correlated noises, based on the Gaussian random field approach.
This package provides a set of abstractions and numerical tools to simulate the dynamics of multi-spin systems under correlated noises based on the Gaussian random field approach.


While we provided specially optimized models for spin shuttling problems. This package can also be used to simulate more general *correlated open-quantum dynamics*.
While we provided specially optimized models for spin shuttling problems, this package can also be used to simulate more general *correlated open-quantum dynamics*.

The following two approaches are supported.
- Direct numerical integration for pure dephasing.
- Monte-Carlo sampling for open-system dynamics.

## About spin shuttling
Spin shuttling has recently emerged as a pivotal technology for large-scale semiconductor quantum computing. By transporting qubits between quantum dots, spin shuttling enables entanglement between non-neighboring qubits, which is essential for quantum error correction. However, the spin qubit becomes decohered by magnetic noise during the shuttling process. Since the noise varies in time and space in a correlated manner, the associated dephasing in a system of several entangled spins often cannot be treated using the standard theory of random processes and requires more advanced mathematical instruments.
In our latest work, we employ the Gaussian random field (GRF) to model the magnetic noise varying in both space and time. By projecting trajectories of spin qubits onto the random field, the correlated noises experienced by multi-spin system can be effectively captured, enabling further study on spin dynamics, dephasing and quantum information applications.
In our latest work, we employ the Gaussian random field (GRF) to model the magnetic noise varying in both space and time. By projecting trajectories of spin qubits onto the random field, the correlated noises experienced by multi-spin systems can be effectively captured, enabling further study on spin dynamics, dephasing, and quantum information applications.

6 changes: 1 addition & 5 deletions docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ TwoSpinParallelModel
dephasingmatrix
```

```@docs
fidelity
```

```@docs
sampling
```

```@docs
averagefidelity
statefidelity
```

```@docs
Expand Down
Loading

0 comments on commit 348d229

Please sign in to comment.