Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Q3mini

Guides

  • Fermionic Quantum Computation
  • Q3: Symbolic Quantum Simulation
  • Quantum Information Systems
  • Quantum Many-Body Systems
  • Quantum Spin Systems

Tech Notes

  • About Q3
  • Q3: Quick Start
  • Quantum Fourier Transform
  • Quantum Information Systems with Q3
  • Quantum Many-Body Systems with Q3
  • Quantum Operations
  • Quantum Spin Systems with Q3
  • Quantum States
  • Quantum Teleportation
  • Quick Quantum Computing with Q3

Symbols

  • Basis
  • Boson
  • Bra
  • CNOT
  • ControlledGate
  • ExpressionFor
  • Fermion
  • Heisenberg
  • Ket
  • Let
  • Majorana
  • Matrix
  • Multiply
  • NambuGreen
  • NambuHermitian
  • NambuMatrix
  • NambuUnitary
  • Pauli
  • Phase
  • QuantumCircuit
  • Qubit
  • Qudit
  • RandomWickCircuitSimulate
  • Rotation
  • Species
  • Spin
  • SWAP
  • WickCircuit
  • WickEntanglementEntropy
  • WickEntropy
  • WickGreenFunction
  • WickJump
  • WickLindbladSolve
  • WickLogarithmicNegativity
  • WickMeasurement
  • WickMonitor
  • WickMutualInformation
  • WickNonunitary
  • WickSimulate
  • WickState
  • WickUnitary

Overviews

  • The Postulates of Quantum Mechanics
  • Quantum Algorithms
  • Quantum Computation: Models
  • Quantum Computation: Overview
  • Quantum Error-Correction Codes
  • Quantum Information Theory
  • Quantum Noise and Decoherence
QuantumMob`Q3mini`
RandomWickCircuitSimulate
​
RandomWickCircuitSimulate
[in,spec,{dep,ds}]
simulates a random quantum circuit specified by
spec
(see
RandomWickCircuit
) on non-interacting fermion modes starting from initial state
in
, where layers of unitary gates alternate with layers of
Fermi measurements
to form an overall depth
dep
. It collects a state at every
ds
layers for each run of quantum circuits.
​
​
RandomWickCircuitSimulate
[in,spec,dep]
is equivalent to
RandomCircuitSimulate
[in,spec,{dep,2}]
, that is, collects states only at measurement layers.
​
Details and Options

Examples  
(11)
Basic Examples  
(3)
Set the number of fermion modes to consider.
In[1]:=
$n=4;
The probability to perform a measurement on each fermion mode.
In[2]:=
$p=.3;
The depth of quantum circuit.
In[3]:=
$T=10;
Take a initial state in the
WickState
form.
In[4]:=
in=WickState[{1,0},$n]
Out[4]=
WickState
Modes: 4
Prefactor: 1

Take a unitary gate in the
WickUnitary
form.
In[5]:=
SeedRandom[370];
In[6]:=
wu=RandomWickUnitary[$n,"Label""U"]
Out[6]=
WickUnitary
Modes: 4
Dimensions: {8,8}

Construct 8 random circuits and simulate each circuit 5 times.
In[7]:=
EchoTiming[​​data=RandomWickCircuitSimulate[in,{wu,$p},$T,"Samples"{50,10}]​​];
⌚
0.901998
Examine the data structure of the result.
In[8]:=
Dimensions[data]
Out[8]=
{50,10,11}
Examine the output states from the second "Wick circuit".
In[9]:=
data〚2,1,5〛
Out[9]=
WickState
Modes: 4
Prefactor: 1

Further convert it into the list of trajectories
{…,{
ws
k1
,
ws
k2
,…,
ws
kt
,…},…}
of Wick states.
In[10]:=
EchoTiming[trj=Flatten[data,1];]
⌚
0.000179
In[11]:=
Dimensions[trj]
Out[11]=
{500,11}
In[12]:=
trj〚1〛
Out[12]=
WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1
,WickState
Modes: 4
Prefactor: 1

In[13]:=
EchoTiming[nrm=Map[NormSquare,trj,{2}];]​​nrm//ArrayShort
⌚
0.005857
Out[13]//MatrixForm=
1
1
1
1
…
1
1
1
1
…
1
1
1
1
…
1
1
1
1
…
…
…
…
…
…
In[14]:=
nrm-1//ArrayZeroQ
Out[14]=
True
​
Take a part of the system, and examine the entanglement between the subsystem and the rest.
In[1]:=
kk=Range[$n/2]
Out[1]=
{1,2}
Calculate the entanglement entropy (EE) between the subsystem and the rest..
In[2]:=
EchoTiming[​​ee=WickEntanglementEntropy[trj,kk]​​];​​Dimensions[ee]
⌚
0.820182
Out[2]=
{500,11}
In[3]:=
ListLinePlot[Mean[ee],​​DataRange{0,$T},​​PlotMarkersAutomatic,​​FrameLabel{"time","〈EE (L, L/2)〉"}]
Out[3]=
Calculate the mutual information (MI) between the subsystem and the rest.
In[4]:=
EchoTiming[​​mi=WickMutualInformation[trj,kk]​​];​​Dimensions[mi]
⌚
2.53692
Out[4]=
{500,11}
In[5]:=
ListLinePlot[Mean[mi],​​DataRange{0,$T},​​PlotMarkersAutomatic,​​FrameLabel{"time","〈MI (L, L/2)〉"}]
Out[5]=
Calculate the logarithmic negativity (LN) between the subsystem and the rest. (Note that here, Re is necessary to ignore small imaginary parts due to numerical errors.)
Finally, construct an approximate density matrices by averaging states in different trajectories, and calculate the the logarithmic negativity (LN) between the subsystem and the rest.
​

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com