@@ -432,7 +432,16 @@ basis_l(b::KetBraBasis) = b.left
432432basis_r (b:: KetBraBasis ) = b. right
433433Base.:(== )(b1:: KetBraBasis , b2:: KetBraBasis ) = (b1. left == b2. left && b1. right == b2. right)
434434dimension (b:: KetBraBasis ) = dimension (b. left)* dimension (b. right)
435+ tensor (b1:: KetBraBasis , b2:: KetBraBasis ) = KetBraBasis (tensor (b1. left,b2. left), tensor (b1. right, b2. right))
435436
437+ """
438+ ChoiBasis(ref_basis,out_basis)
439+
440+ The Choi basis is used to represent superoperators in the Choi representation
441+ where the `ref_basis` denotes the ancillary reference system with which an input
442+ state will be jointly measured in order to accomplish teleportation simulation
443+ of the channel with the channel's output appearing in the `out_basis` system.
444+ """
436445struct ChoiBasis{BL<: Basis , BR<: Basis } <: Basis
437446 ref:: BL
438447 out:: BR
@@ -441,7 +450,13 @@ basis_l(b::ChoiBasis) = b.ref
441450basis_r (b:: ChoiBasis ) = b. out
442451Base.:(== )(b1:: ChoiBasis , b2:: ChoiBasis ) = (b1. ref == b2. ref && b1. out == b2. out)
443452dimension (b:: ChoiBasis ) = dimension (b. ref)* dimension (b. out)
453+ tensor (b1:: ChoiBasis , b2:: ChoiBasis ) = ChoiBasis (tensor (b1. ref,b2. ref), tensor (b1. out, b2. out))
444454
455+ function _check_is_spinhalfbasis (b)
456+ for i= 1 : length (b)
457+ (b[i] isa SpinBasis && dimension (b[i]) == 2 ) || throw (ArgumentError (" Must have only SpinBasis(1//2) to be compatible with pauli representation" ))
458+ end
459+ end
445460"""
446461 PauliBasis(N)
447462
@@ -452,11 +467,43 @@ The dimension of the basis is 2²ᴺ.
452467struct PauliBasis{T<: Integer } <: Basis
453468 N:: T
454469end
470+ function PauliBasis (bl:: Basis , br:: Basis )
471+ bl == br || throw (ArgumentError (" Both bases must be equal" ))
472+ _check_is_spinhalfbasis (bl)
473+ PauliBasis (length (bl))
474+ end
475+ basis_l (b:: PauliBasis ) = SpinBasis (1 // 2 )^ b. N
476+ basis_r (b:: PauliBasis ) = SpinBasis (1 // 2 )^ b. N
455477Base.:(== )(b1:: PauliBasis , b2:: PauliBasis ) = b1. N == b2. N
456- shape (b:: PauliBasis ) = fill (4 , b. N)
457478dimension (b:: PauliBasis ) = 4 ^ b. N
458- Base. length (b:: PauliBasis ) = b. N
459- Base. getindex (b:: PauliBasis , i) = PauliBasis (length (i))
479+ tensor (b1:: PauliBasis , b2:: PauliBasis ) = PauliBasis (b1. N+ b2. N)
480+
481+ """
482+ ChiBasis(N)
483+
484+ The basis for a Chi process matrix, which is just the Choi state in the Pauli
485+ operator basis. However we do not use the `ChoiBasis`, partly to have easier
486+ dispatch on types, and partly because there's no sensible way to distingish
487+ between the "reference" and "output" systems as that information is lost in the
488+ computational to Pauli basis transformation (i.e. two indices into one).
489+
490+ TODO explain better why dimension base is 2, see sec III.E.
491+ """
492+ struct ChiBasis{T<: Integer } <: Basis
493+ Nl:: T
494+ Nr:: T
495+ end
496+ ChiBasis (N) = ChiBasis (N,N)
497+ function ChiBasis (bl:: Basis , br:: Basis )
498+ _check_is_spinhalfbasis (bl)
499+ _check_is_spinhalfbasis (br)
500+ ChiBasis (length (bl), length (br))
501+ end
502+ basis_l (b:: ChiBasis ) = SpinBasis (1 // 2 )^ b. Nl
503+ basis_r (b:: ChiBasis ) = SpinBasis (1 // 2 )^ b. Nr
504+ Base.:(== )(b1:: ChiBasis , b2:: ChiBasis ) = (b1. Nl == b2. Nl && b1. Nr == b2. Nr)
505+ dimension (b:: ChiBasis ) = 2 ^ (b. Nl+ b. Nr)
506+ tensor (b1:: ChiBasis , b2:: ChiBasis ) = ChiBasis (b1. Nl+ b2. Nl, b1. Nr+ b2. Nr)
460507
461508"""
462509 HWPauliBasis(N)
0 commit comments