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`
Bra
​
Bra[
b
1
,
b
2
,…]
represents the dual vector of
Ket
[
b
1
,
b
2
,…]
.
​
​
Bra[
s
1

b
1
,
s
2

b
2
,…]
represents the dual vector of
Ket
[
s
1

b
1
,
s
2

b
2
,…]
.
​
Details and Options

Examples  
(5)
Basic Examples  
(5)
Consider a state vector for unlabeled qubits.
In[1]:=
v=Ket[0,1]
Out[1]=
|0,1〉
The corresponding dual vector is denoted by
Bra[…]
.
In[2]:=
dv=Dagger[v]
Out[2]=
〈0,1|
You can specify it explicitly.
In[3]:=
Bra[0,1]
Out[3]=
〈0,1|
The Hermitian product 〈u,v〉 between two vectors can be obtained by the non-commutative multiplication of
〈u|
and
|v〉
.
In[4]:=
u=Ket[0,1]+IKet[1,0]​​v=Ket[0,1]+Ket[1,0]
Out[4]=
|0,1〉+|1,0〉
Out[4]=
|0,1〉+|1,0〉
In[5]:=
Dagger[u]
Out[5]=
〈0,1|-〈1,0|
In[6]:=
Dagger[u]**v
Out[6]=
1-
​
Now consider a system of labeled qubits.
In[1]:=
Let[Qubit,S]
In[2]:=
Bra[S[1]1]​​Bra[S[1,$]1]​​Bra[S[1,$]1]​​Bra[S[1,$,$]1]
Out[2]=

1
S
1

Out[2]=

1
S
1

Out[2]=

1
S
1

Out[2]=

1
S
1

In[3]:=
u=Bra[S[1]1]​​v=Bra[u,S[3]1]​​w=v[S[2]1]​​w[S[2]]
Out[3]=

1
S
1

Out[3]=

1
S
1
1
S
3

Out[3]=

1
S
1
1
S
2
1
S
3

Out[3]=
1
By default, the Bra expression is optimized for calculation, and hence it may look weird at first.
In[4]:=
v=Bra[S[1]0]+IBra[S[1]1]
Out[4]=

0
S
1
+
1
S
1

The KetRegulate of a Bra may be more human readable, but it can slow down the subsequent calculations.
In[5]:=
v=Bra[]+IBra[S[1]1]
Out[5]=
〈␣|+
1
S
1

In[6]:=
w=v//KetRegulate​​w//KetTrim
Out[6]=

0
S
1
+
1
S
1

Out[6]=
〈␣|+
1
S
1

In[7]:=
Bra[S[{1,2,3,4}]{0,0,1,0},S[5]0]
Out[7]=

0
S
1
0
S
2
1
S
3
0
S
4
0
S
5

In[8]:=
ss=S[{1,2,3}]​​Bra[ss{0,0,1}]​​Bra[ss1]
Out[8]=
{
x
S
,
y
S
,
z
S
}
Out[8]=

0
S
1
0
S
2
1
S
3

Out[8]=

1
S
1
1
S
2
1
S
3

In[9]:=
v​​w=v**S[2,1]**S[1,1]​​u=w**S[3,2]
Out[9]=
〈␣|+
1
S
1

Out[9]=

0
S
1
1
S
2
+
1
S
1
1
S
2

Out[9]=

0
S
1
1
S
2
1
S
3
-
1
S
1
1
S
2
1
S
3

In[10]:=
u//KetRegulate​​matU=Matrix[u];matU//MatrixForm​​uu=u⊗Bra[S[2]1]​​matUU=Matrix[uu];​​matUU//MatrixForm
Out[10]=

0
S
1
1
S
2
1
S
3
-
1
S
1
1
S
2
1
S
3

Out[10]//MatrixForm=
0
0
0
1
0
0
0
-
Out[10]=

0
S
1
1
S
2
1
S
3
-
1
S
1
1
S
2
1
S
3

Out[10]//MatrixForm=
0
0
0
1
0
0
0
-
In[11]:=
uu=ExpressionFor[Conjugate@matU,{S[1],S[2],S[3]}]​​Dagger@uu
Out[11]=

0
S
1
1
S
2
1
S
3
+
1
S
1
1
S
2
1
S
3

​
You can add additional elements or modifies existing elements.
​
Accessing the values
​

© 2025 Wolfram. All rights reserved.

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