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`
Spin
​
Spin
refers to either the
Spin
species itself or an option for the
Boson
,
Fermion
or
Spin
species.
​
​
Spin
[c]
returns the value of
Spin
associated with the species
c
. The allowed species include
Fermion
,
Boson
, and
Spin
.
​
Details and Options

Examples  
(6)
Basic Examples  
(4)
In[1]:=
Let[Spin,J]
In[2]:=
Dagger[J[1,3]]​​Dagger[J[1,3]]//TeXForm
Out[2]=
Z
J
1
Out[2]//TeXForm=
J_1^{ ext{Z}}
In[3]:=
J[1,1]**J[1,1]**J[2]​​J[1,2]**(J[1,2]**J[1,3])​​J[3]**J[3]**J[1,3]
Out[3]=
Y
J
4
Out[3]=
Z
J
1
4
Out[3]=
Z
J
1
4
In[4]:=
J[1,4]
Out[4]=
+
J
1
In[5]:=
J[1,6]
Out[5]=
H
J
1
In[6]:=
J[a,3]
Out[6]=
Z
J
a
Consider the computation basis for a two-spin system.
In[7]:=
bs=Basis[J@{1,2}]
Out[7]=

1
2
J
1
1
2
J
2
,
1
2
J
1
-
1
2
J
2
,
-
1
2
J
1
1
2
J
2
,
-
1
2
J
1
-
1
2
J
2

In[8]:=
J[1,4]**bs​​J[1,5]**bs
Out[8]=
0,0,
1
2
J
1
1
2
J
2
,
1
2
J
1
-
1
2
J
2

Out[8]=

-
1
2
J
1
1
2
J
2
,
-
1
2
J
1
-
1
2
J
2
,0,0
In[9]:=
J[3,4]**bs​​J[3,5]**bs
Out[9]=
{0,0,0,0}
Out[9]=

1
2
J
1
1
2
J
2
-
1
2
J
3
,
1
2
J
1
-
1
2
J
2
-
1
2
J
3
,
-
1
2
J
1
1
2
J
2
-
1
2
J
3
,
-
1
2
J
1
-
1
2
J
2
-
1
2
J
3

In[10]:=
J[1,1]**bs​​J[1,2]**bs​​J[1,3]**bs
Out[10]=

1
2

-
1
2
J
1
1
2
J
2
,
1
2

-
1
2
J
1
-
1
2
J
2
,
1
2

1
2
J
1
1
2
J
2
,
1
2

1
2
J
1
-
1
2
J
2

Out[10]=

1
2

-
1
2
J
1
1
2
J
2
,
1
2

-
1
2
J
1
-
1
2
J
2
,-
1
2

1
2
J
1
1
2
J
2
,-
1
2

1
2
J
1
-
1
2
J
2

Out[10]=

1
2

1
2
J
1
1
2
J
2
,
1
2

1
2
J
1
-
1
2
J
2
,-
1
2

-
1
2
J
1
1
2
J
2
,-
1
2

-
1
2
J
1
-
1
2
J
2

​
In[1]:=
Let[Spin,J,Spin1]
In[2]:=
J[1,2]**J[1,0]**J[1,2]**J[1,0]**J[1,0]
Out[2]=
Y
J
1
Y
J
1
In[3]:=
J[a,1]**J[1,2]**J[1,0]**J[1,2]**J[1,0]**J[1,0]
Out[3]=
Y
J
1
Y
J
1
X
J
a
In[4]:=
J[1,0]**J[1,0]**J[1,0]**J[1,0]**J[1,0]
Out[4]=
0
J
1
​
In[1]:=
Let[Spin,S,Spin2]
In[2]:=
S[2]
Out[2]=
Y
S
In[3]:=
S^2**S^2
Out[3]=
SSSS
In[4]:=
J[3]**J[1]**J[2]
Out[4]=
-
X
J
X
J
+
Y
J
Y
J
+
X
J
Y
J
Z
J
In[5]:=
J[1,1]**J[2,1]+J[1,2]**J[2,2]+J[1,3]**J[2,3]
Out[5]=
X
J
1
X
J
2
+
Y
J
1
Y
J
2
+
Z
J
1
Z
J
2
In[6]:=
MultiplyDot[J[1,All],J[2,All]]
Out[6]=
X
J
1
X
J
2
+
Y
J
1
Y
J
2
+
Z
J
1
Z
J
2
In[7]:=
J[4,4]//TeXForm
Out[7]//TeXForm=
J_4^+
In[8]:=
J[1,0]**J[1,1,2]**J[2,3]**J[1]**J[2,3]**J[1,2,1]
Out[8]=
X
J
0
J
1
Z
J
2
Z
J
2
Y
J
1,1
X
J
1,2
​
In[1]:=
Let[Fermion,c,Vacuum"Sea"]​​Let[Fermion,d]​​Let[Fermion,f,Spin0,Vacuum"Sea"]
In[2]:=
Spin[c]
Out[2]=
1
2
For an operator with non-zero spin, the last flavor index should be consistent with the proper spin component. In the example below, the flavor index was not consistent and hence the spin is regarded as zero:
In[3]:=
Spin[c[1]]​​Spin[Dagger[c[1]]]
Out[3]=
0
Out[3]=
0
Compare the above example with the one below.
In[4]:=
Spin[c[1,1/2]]
Out[4]=
1
2
Therefore, while this is legitimate
In[5]:=
FockSpin[c[1]]
Out[5]=

1
2
†
c
1,↓
c
1,↑
+
1
2
†
c
1,↑
c
1,↓
,
1
2

†
c
1,↓
c
1,↑
-
1
2

†
c
1,↑
c
1,↓
,-
1
2
†
c
1,↓
c
1,↓
+
1
2
†
c
1,↑
c
1,↑

the following is problematic
You can see why by the following examples.
Sometimes one may not care about the precise spin. Then you can turn off the message.
Of course, you can turn it on again whenever you want.

© 2025 Wolfram. All rights reserved.

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