|
1 | 1 | """ |
2 | | -Abstract base class for `Bra` and `Ket` states. |
| 2 | +Abstract type for all state vectors. |
3 | 3 |
|
4 | | -The state vector class stores the coefficients of an abstract state |
5 | | -in respect to a certain basis. These coefficients are stored in the |
6 | | -`data` field and the basis is defined in the `basis` |
7 | | -field. |
| 4 | +This type represents any abstract pure quantum state as given by an element of a |
| 5 | +Hilbert space with respect to a certain basis. To be compatible with methods |
| 6 | +defined in `QuantumInterface`, all subtypes must implement the `basis` method |
| 7 | +which should return a subtype of the abstract [`Basis`](@ref) type. |
| 8 | +
|
| 9 | +See also [`AbstractKet`](@ref) and [`AbstractBra`](@ref). |
8 | 10 | """ |
9 | | -abstract type StateVector{B,T} end |
10 | | -abstract type AbstractKet{B,T} <: StateVector{B,T} end |
11 | | -abstract type AbstractBra{B,T} <: StateVector{B,T} end |
| 11 | +abstract type StateVector end |
12 | 12 |
|
13 | 13 | """ |
14 | | -Abstract base class for all operators. |
| 14 | +Abstract type for `Ket` states. |
15 | 15 |
|
16 | | -All deriving operator classes have to define the fields |
17 | | -`basis_l` and `basis_r` defining the left and right side bases. |
| 16 | +This subtype of [`StateVector`](@ref) is meant to represent `Ket` states which |
| 17 | +are related to their dual `Bra` by the conjugate transpose. |
18 | 18 |
|
19 | | -For fast time evolution also at least the function |
20 | | -`mul!(result::Ket,op::AbstractOperator,x::Ket,alpha,beta)` should be |
21 | | -implemented. Many other generic multiplication functions can be defined in |
22 | | -terms of this function and are provided automatically. |
| 19 | +See also [`AbstractBra`](@ref). |
23 | 20 | """ |
24 | | -abstract type AbstractOperator{BL,BR} end |
| 21 | +abstract type AbstractKet <: StateVector end |
| 22 | + |
| 23 | +""" |
| 24 | +Abstract type for `Bra` states. |
| 25 | +
|
| 26 | +This subtype of [`StateVector`](@ref) is meant to represent `Bra` states which |
| 27 | +are related to their dual `Ket` by the conjugate transpose. |
25 | 28 |
|
| 29 | +See also [`AbstractBra`](@ref). |
26 | 30 | """ |
27 | | -Base class for all super operator classes. |
| 31 | +abstract type AbstractBra <: StateVector end |
28 | 32 |
|
29 | | -Super operators are bijective mappings from operators given in one specific |
30 | | -basis to operators, possibly given in respect to another, different basis. |
31 | | -To embed super operators in an algebraic framework they are defined with a |
32 | | -left hand basis `basis_l` and a right hand basis `basis_r` where each of |
33 | | -them again consists of a left and right hand basis. |
34 | | -```math |
35 | | -A_{bl_1,bl_2} = S_{(bl_1,bl_2) ↔ (br_1,br_2)} B_{br_1,br_2} |
36 | | -\\\\ |
37 | | -A_{br_1,br_2} = B_{bl_1,bl_2} S_{(bl_1,bl_2) ↔ (br_1,br_2)} |
38 | | -``` |
39 | 33 | """ |
40 | | -abstract type AbstractSuperOperator{B1,B2} end |
| 34 | +Abstract type for all operators and super operators. |
| 35 | +
|
| 36 | +This type represents any abstract mixed quantum state given by a density |
| 37 | +operator (or superoperator) mapping between two Hilbert spaces. All subtypes |
| 38 | +must implement the [`basis_l`](@ref) and [`basis_r`](@ref) methods which return |
| 39 | +subtypes of [`Basis`](@ref) representing the left and right bases that the |
| 40 | +operator maps between. A subtype is considered compatible with multiplication by |
| 41 | +a subtype of [`AbstractBra`](@ref) defined in same left basis as the operator |
| 42 | +and a subtype of [`AbstractKet`](@ref) defined in the same right basis as the |
| 43 | +operator. |
| 44 | +
|
| 45 | +For fast time evolution also at least the function |
| 46 | +`mul!(result::Ket,op::AbstractOperator,x::Ket,alpha,beta)` should be |
| 47 | +implemented. Many other generic multiplication functions can be defined in terms |
| 48 | +of this function and are provided automatically. |
| 49 | +""" |
| 50 | +abstract type AbstractOperator end |
41 | 51 |
|
42 | 52 | function summary(stream::IO, x::AbstractOperator) |
43 | 53 | print(stream, "$(typeof(x).name.name)(dim=$(length(x.basis_l))x$(length(x.basis_r)))\n") |
44 | | - if samebases(x) |
| 54 | + if multiplicable(x,x) |
45 | 55 | print(stream, " basis: ") |
46 | 56 | show(stream, basis(x)) |
47 | 57 | else |
|
0 commit comments