Difference between revisions of "PauliChannel"
Jump to navigation
Jump to search
(Created page with "{{Function |name=PauliChannel |desc=Generates a Pauli channel |rel=Pauli |cat=Superoperators |upd=December 16, 2014}} <tt>'''PauliChan...") |
(Fixed scaling of probability vector) |
||
| Line 58: | Line 58: | ||
The following code generates a Pauli channel with Kraus operators $\left\{\tfrac{1}{\sqrt{15}}I,\tfrac{2}{\sqrt{15}}X,\tfrac{3}{\sqrt{15}}Y,\tfrac{4}{\sqrt{15}}Z\right\}$, where $I,X,Y,Z$ are the usual [[Pauli|Pauli operators]]: | The following code generates a Pauli channel with Kraus operators $\left\{\tfrac{1}{\sqrt{15}}I,\tfrac{2}{\sqrt{15}}X,\tfrac{3}{\sqrt{15}}Y,\tfrac{4}{\sqrt{15}}Z\right\}$, where $I,X,Y,Z$ are the usual [[Pauli|Pauli operators]]: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
| − | >> Phi = full(PauliChannel([1,2,3,4]/ | + | >> Phi = full(PauliChannel([1,2,3,4]/10)) |
Phi = | Phi = | ||
| − | 0. | + | 0.5000 0 0 -0.3000 |
| − | 0 0. | + | 0 0.5000 -0.1000 0 |
| − | 0 -0. | + | 0 -0.1000 0.5000 0 |
| − | -0. | + | -0.3000 0 0 0.5000 |
>> celldisp(KrausOperators(Phi)) % look at its Kraus operators | >> celldisp(KrausOperators(Phi)) % look at its Kraus operators | ||
| Line 71: | Line 71: | ||
ans{1} = | ans{1} = | ||
| − | -0. | + | -0.6325 0 |
| − | 0 0. | + | 0 0.6325 |
| Line 78: | Line 78: | ||
ans{2} = | ans{2} = | ||
| − | + | 0 -0.5477 | |
| − | + | 0.5477 0 | |
| Line 85: | Line 85: | ||
ans{3} = | ans{3} = | ||
| − | + | 0 -0.4472 | |
| − | + | -0.4472 0 | |
| Line 92: | Line 92: | ||
ans{4} = | ans{4} = | ||
| − | -0. | + | -0.3162 0 |
| − | 0 -0. | + | 0 -0.3162 |
</syntaxhighlight> | </syntaxhighlight> | ||
{{SourceCode|name=PauliChannel}} | {{SourceCode|name=PauliChannel}} | ||
Latest revision as of 12:53, 28 March 2025
| PauliChannel | |
| Generates a Pauli channel | |
| Other toolboxes required | none |
|---|---|
| Related functions | Pauli |
| Function category | Superoperators |
PauliChannel is a function that generates the Choi matrix of a Pauli channel (either a random Pauli channel on a specified number of qubits, or a specific Pauli channel requested by the user). The output of this function is sparse.
Syntax
- PHI = PauliChannel(P)
Argument descriptions
- P: Either a positive integer, indicating that the user wants a randomly-generated P-qubit Pauli channel. Otherwise, P should be a probability vector of length $4^q$ for some integer $q \geq 1$, whose entries specify the weights of the Pauli operators in the channel's Kraus decomposition. More specifically, the weight of the $j$-th Pauli operator (in lexicographical order) in the Kraus operator representation of this channel will be $\sqrt{P(j)}$.
Examples
A random 1-qubit Pauli channel
The following code returns the Choi matrix a randomly-generated 1-qubit Pauli channel:
>> Phi = full(PauliChannel(1)) % generate the random Pauli channel
Phi =
0.5737 0 0 0.1346
0 0.4263 0.3196 0
0 0.3196 0.4263 0
0.1346 0 0 0.5737
>> celldisp(KrausOperators(Phi)) % look at its Kraus operators
ans{1} =
0 0.6107
0.6107 0
ans{2} =
0.5951 0
0 0.5951
ans{3} =
0.4686 0
0 -0.4686
ans{4} =
0 0.2310
-0.2310 0A specific Pauli channel
The following code generates a Pauli channel with Kraus operators $\left\{\tfrac{1}{\sqrt{15}}I,\tfrac{2}{\sqrt{15}}X,\tfrac{3}{\sqrt{15}}Y,\tfrac{4}{\sqrt{15}}Z\right\}$, where $I,X,Y,Z$ are the usual Pauli operators:
>> Phi = full(PauliChannel([1,2,3,4]/10))
Phi =
0.5000 0 0 -0.3000
0 0.5000 -0.1000 0
0 -0.1000 0.5000 0
-0.3000 0 0 0.5000
>> celldisp(KrausOperators(Phi)) % look at its Kraus operators
ans{1} =
-0.6325 0
0 0.6325
ans{2} =
0 -0.5477
0.5477 0
ans{3} =
0 -0.4472
-0.4472 0
ans{4} =
-0.3162 0
0 -0.3162Source code
Click here to view this function's source code on github.