Navigation Menu

Skip to content

Commit

Permalink
Fix a few errors in docstrings.
Browse files Browse the repository at this point in the history
* Spelling mistakes.
* Mistakes in latex formulas.
  • Loading branch information
bastikr committed Apr 19, 2017
1 parent 6b94451 commit 6d0fd91
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
6 changes: 3 additions & 3 deletions src/bases.jl
Expand Up @@ -16,7 +16,7 @@ The Basis class is meant to specify a basis of the Hilbert space of the
studied system. Besides basis specific information all subclasses must
implement a shape variable which indicates the dimension of the used
Hilbert space. For a spin-1/2 Hilbert space this would be the
vector `Int[2]`. A system composed of 2 spins would then have a
vector `Int[2]`. A system composed of two spins would then have a
shape vector `Int[2 2]`.
Composite systems can be defined with help of the [`CompositeBasis`](@ref)
Expand Down Expand Up @@ -247,8 +247,8 @@ ptrace(a, index::Int) = ptrace(a, Int[index])
Change the ordering of the subsystems of the given object.
For a permutation vector [2,1,3] and a given object with basis [b1, b2, b3]
this function results in [b2, b1, b3].
For a permutation vector `[2,1,3]` and a given object with basis `[b1, b2, b3]`
this function results in `[b2, b1, b3]`.
"""
function permutesystems(b::CompositeBasis, perm::Vector{Int})
@assert length(b.bases) == length(perm)
Expand Down
2 changes: 1 addition & 1 deletion src/fock.jl
Expand Up @@ -80,7 +80,7 @@ end
"""
coherentstate(b::FockBasis, alpha)
Coherent state `|α⟩` for the specified Fock space.
Coherent state ``|α⟩`` for the specified Fock space.
"""
function coherentstate(b::FockBasis, alpha::Number, result=Ket(b, Vector{Complex128}(length(b))))
alpha = complex(alpha)
Expand Down
9 changes: 3 additions & 6 deletions src/manybody.jl
Expand Up @@ -214,20 +214,17 @@ moment not implemented.
The mathematical formalism for the one-body case is described by
```math
X = \\sum_{ij} a_i^† a_j \\left⟨u_i \right| x \\left| u_j \\right
X = \\sum_{ij} a_i^† a_j ⟨u_i| x | u_j⟩
```
and for the interaction case by
```math
X = \\sum_{ijkl} a_i^† a_j^† a_k a_l
\\left⟨ u_i \\right| \\left⟨ u_j \\right|
x
\\left| u_k \\right⟩ \\left| u_l \\right⟩
X = \\sum_{ijkl} a_i^† a_j^† a_k a_l ⟨u_i|⟨u_j| x |u_k⟩|u_l⟩
```
where ``X`` is the N-particle operator, ``x`` is the one-body operator and
``\\left| u \\right⟩`` are the one-body states associated to the
``|u⟩`` are the one-body states associated to the
different modes of the N-particle basis.
"""
function manybodyoperator{T<:Operator}(basis::ManyBodyBasis, op::T)::T
Expand Down
4 changes: 2 additions & 2 deletions src/mcwf.jl
Expand Up @@ -166,8 +166,8 @@ Integrate the master equation using the MCWF method.
There are two implementations for integrating the non-hermitian
schroedinger equation:
* ``mcwf_h``: Usual formulation with Hamiltonian + jump operators separately.
* ``mcwf_nh``: Variant with non-hermitian Hamiltonian.
* [`mcwf_h`](@ref): Usual formulation with Hamiltonian + jump operators separately.
* [`mcwf_nh`](@ref): Variant with non-hermitian Hamiltonian.
The ``mcwf`` function takes a normal Hamiltonian, calculates the
non-hermitian Hamiltonian and then calls mcwf_nh which is slightly faster.
Expand Down
2 changes: 1 addition & 1 deletion src/nlevel.jl
Expand Up @@ -28,7 +28,7 @@ end
"""
transition(b::NLevelBasis, to::Int, from::Int)
Transition operator ``|to><from|``.
Transition operator ``|\\mathrm{to}⟩⟨\\mathrm{from}|``.
"""
function transition(b::NLevelBasis, to::Int, from::Int)
if to < 1 || b.N < to
Expand Down
18 changes: 9 additions & 9 deletions src/operators.jl
Expand Up @@ -16,10 +16,10 @@ export Operator,
Abstract base class for all operators.
All deriving operator classes have to define the fields
basis_l and basis_r defining the left and right side bases.
`basis_l` and `basis_r` defining the left and right side bases.
For fast time evolution also at least the function
gemv!(alpha, op::Operator, x::Ket, beta, result::Ket) should be
`gemv!(alpha, op::Operator, x::Ket, beta, result::Ket)` should be
implemented. Many other generic multiplication functions can be defined in
terms of this function and are provided automatically.
"""
Expand Down Expand Up @@ -71,14 +71,14 @@ ptrace(a::Operator, index::Vector{Int}) = arithmetic_unary_error("Partial trace"
"""
normalize(op)
Return the normalized operator so that its trace is one.
Return the normalized operator so that its `trace(op)` is one.
"""
normalize(op::Operator) = op/trace(op)

"""
normalize!(op)
In-place normalization of the given operator so that its trace is one.
In-place normalization of the given operator so that its `trace(x)` is one.
"""
normalize!(op::Operator) = throw(ArgumentError("normalize! is not defined for this type of operator: $(typeof(op)).\n You may have to fall back to the non-inplace version 'normalize()'."))

Expand All @@ -105,7 +105,7 @@ end
"""
expect(index, op, state)
If `index` is given, it assumes that
If an `index` is given, it assumes that `op` is defined in the subsystem specified by this number.
"""
expect(index::Int, op::Operator, state) = expect([index], op, state)
expect(op::Operator, states::Vector) = [expect(op, state) for state=states]
Expand Down Expand Up @@ -203,8 +203,8 @@ embed{T<:Operator}(basis::CompositeBasis, operators::Dict{Vector{Int}, T}; kwarg
Fast in-place multiplication of operators with state vectors. It
implements the relation `result = beta*result + alpha*a*b`.
`alpha` and `beta` are complex numbers. `result` and either `a` or `b`
are state vectors while the other one can be of any operator type.
Here, `alpha` and `beta` are complex numbers, while `result` and either `a`
or `b` are state vectors while the other one can be of any operator type.
"""
gemv!() = error("Not Implemented.")

Expand All @@ -213,8 +213,8 @@ gemv!() = error("Not Implemented.")
Fast in-place multiplication of of operators with DenseOperators. It
implements the relation `result = beta*result + alpha*a*b`.
`alpha` and `beta` are complex numbers. `result` and either `a` or `b`
are dense operators while the other one can be of any operator type.
Here, `alpha` and `beta` are complex numbers, while `result` and either `a`
or `b` are dense operators while the other one can be of any operator type.
"""
gemm!() = error("Not Implemented.")

Expand Down
1 change: 1 addition & 0 deletions src/operators_dense.jl
Expand Up @@ -37,6 +37,7 @@ Base.copy(x::DenseOperator) = deepcopy(x)
Convert an arbitrary Operator into a [`DenseOperator`](@ref).
"""
Base.full(x::Operator) = throw(ArgumentError("Conversion from $(typeof(a)) to a DenseOperator not implemented."))
Base.full(x::DenseOperator) = deepcopy(x)

==(x::DenseOperator, y::DenseOperator) = (x.basis_l == y.basis_l) && (x.basis_r == y.basis_r) && (x.data == y.data)
Expand Down
8 changes: 4 additions & 4 deletions src/operators_lazyproduct.jl
Expand Up @@ -12,11 +12,11 @@ export LazyProduct
LazyProduct(operators[, factor=1])
LazyProduct(op1, op2...)
Lazy evaluation of product of operators.
Lazy evaluation of products of operators.
The factors of the product are stored in the "operators" field. Additionally a
complex factor is stored in the "factor" field which allows for fast
multiplication with a number.
The factors of the product are stored in the `operators` field. Additionally a
complex factor is stored in the `factor` field which allows for fast
multiplication with numbers.
"""
type LazyProduct <: Operator
basis_l::Basis
Expand Down
5 changes: 3 additions & 2 deletions src/operators_lazysum.jl
Expand Up @@ -11,10 +11,11 @@ export LazySum
"""
LazySum([factors,] operators)
Lazy evaluation of sum of operators.
Lazy evaluation of sums of operators.
All operators have to be given in respect to the same bases. The field
factors accounts for an additional multiplicative factor for each operator.
`factors` accounts for an additional multiplicative factor for each operator
stored in the `operators` field.
"""
type LazySum <: Operator
basis_l::Basis
Expand Down
8 changes: 4 additions & 4 deletions src/operators_lazytensor.jl
Expand Up @@ -14,10 +14,10 @@ export LazyTensor
Lazy implementation of a tensor product of operators.
The suboperators are stored in the "operators" field. The "indices" field
specifies to which subsystem the corresponding operator lives. Additionally,
a complex factor is stored in the "factor" field which allows for fast
multiplication with a number.
The suboperators are stored in the `operators` field. The `indices` field
specifies in which subsystem the corresponding operator lives. Additionally,
a complex factor is stored in the `factor` field which allows for fast
multiplication with numbers.
"""
type LazyTensor <: Operator
basis_l::CompositeBasis
Expand Down
2 changes: 1 addition & 1 deletion src/spin.jl
Expand Up @@ -14,7 +14,7 @@ Basis for spin-n particles.
The basis can be created for arbitrary spinnumbers by using a rational number,
e.g. `SpinBasis(3//2)`. The Pauli operators are defined for all possible
spinnumbers.
spin numbers.
"""
type SpinBasis <: Basis
shape::Vector{Int}
Expand Down
6 changes: 3 additions & 3 deletions src/states.jl
Expand Up @@ -10,7 +10,7 @@ export StateVector, Bra, Ket,


"""
Abstract base class for Bra and Ket states.
Abstract base class for [`Bra`](@ref) and [`Ket`](@ref) states.
The state vector class stores the coefficients of an abstract state
in respect to a certain basis. These coefficients are stored in the
Expand All @@ -22,7 +22,7 @@ abstract StateVector
"""
Bra(b::Basis[, data])
Bra state defined by coefficients in respect to a basis.
Bra state defined by coefficients in respect to the basis.
"""
type Bra <: StateVector
basis::Basis
Expand All @@ -33,7 +33,7 @@ end
"""
Ket(b::Basis[, data])
Ket state defined by coefficients in respect to a basis.
Ket state defined by coefficients in respect to the given basis.
"""
type Ket <: StateVector
basis::Basis
Expand Down
7 changes: 4 additions & 3 deletions src/superoperators.jl
Expand Up @@ -18,10 +18,11 @@ left hand basis `basis_l` and a right hand basis `basis_r` where each of
them again consists of a left and right hand basis.
```math
A_{bl_1,bl_2} &= S_{(bl_1,bl_2)<->(br_1,br_2)} B_{br_1,br_2}
\\
A_{br_1,br_2} &= B_{bl_1,bl_2} S_{(bl_1,bl_2)<->(br_1,br_2)}
A_{bl_1,bl_2} = S_{(bl_1,bl_2)(br_1,br_2)} B_{br_1,br_2}
\\\\
A_{br_1,br_2} = B_{bl_1,bl_2} S_{(bl_1,bl_2)(br_1,br_2)}
```
"""
abstract SuperOperator

Expand Down

0 comments on commit 6d0fd91

Please sign in to comment.