In[]:=
PacletInstall["Wolfram/QuantumFramework"]Needs["Wolfram`QuantumFramework`"]
Out[]=
PacletObject
Simple Not:
In[]:=
ops={QuantumOperator["NOT",{1}],QuantumMeasurementOperator["ComputationalBasis",{1}]};
In[]:=
circuit=QuantumCircuitOperator[ops]
Out[]=
QuantumCircuitOperator
In[]:=
circuit["Diagram"]
Out[]=
In[]:=
circuit["Matrix"]//MatrixForm
Out[]//MatrixForm=
0 | 1 |
0 | 0 |
0 | 0 |
1 | 0 |
In[]:=
QuantumOperator["NOT",{1}]["Matrix"]//MatrixForm
Out[]//MatrixForm=
0 | 1 |
1 | 0 |
The input state is , where and are unknown amplitudes.
|ψ〉=α|0〉+β|1〉
α
β
In[]:=
ψ0=QuantumState[{α,β}]
Out[]=
QuantumState
In[]:=
QuantumState[ψ0]["Amplitudes"]
Out[]=
|0〉α,|1〉β
Let’s look at post-measurement states
In[]:=
circuit[ψ0]["StateAmplitudes"]
Out[]=
|0〉|0〉β,|1〉0,|1〉|0〉0,|1〉α