Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/Code-Quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
matrix:
version:
- 'lts'
- '1'
os:
- 'ubuntu-latest'
arch:
Expand Down
18 changes: 6 additions & 12 deletions src/qobj/boolean_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,47 @@ export isunitary

Checks if the [`QuantumObject`](@ref) `A` is a [`Bra`](@ref). Default case returns `false` for any other inputs.
"""
isbra(A::QuantumObject) = isbra(typeof(A))
isbra(::Type{<:QuantumObject{Bra,N}}) where {N} = true
isbra(A::QuantumObject{Bra}) = true
isbra(A) = false # default case

@doc raw"""
isket(A)

Checks if the [`QuantumObject`](@ref) `A` is a [`Ket`](@ref). Default case returns `false` for any other inputs.
"""
isket(A::QuantumObject) = isket(typeof(A))
isket(::Type{<:QuantumObject{Ket,N}}) where {N} = true
isket(A::QuantumObject{Ket}) = true
isket(A) = false # default case

@doc raw"""
isoper(A)

Checks if the [`AbstractQuantumObject`](@ref) `A` is a [`Operator`](@ref). Default case returns `false` for any other inputs.
"""
isoper(A::AbstractQuantumObject) = isoper(typeof(A))
isoper(::Type{<:AbstractQuantumObject{Operator,N}}) where {N} = true
isoper(A::AbstractQuantumObject{Operator}) = true
isoper(A) = false # default case

@doc raw"""
isoperbra(A)

Checks if the [`QuantumObject`](@ref) `A` is a [`OperatorBra`](@ref). Default case returns `false` for any other inputs.
"""
isoperbra(A::QuantumObject) = isoperbra(typeof(A))
isoperbra(::Type{<:QuantumObject{OperatorBra,N}}) where {N} = true
isoperbra(A::QuantumObject{OperatorBra}) = true
isoperbra(A) = false # default case

@doc raw"""
isoperket(A)

Checks if the [`QuantumObject`](@ref) `A` is a [`OperatorKet`](@ref). Default case returns `false` for any other inputs.
"""
isoperket(A::QuantumObject) = isoperket(typeof(A))
isoperket(::Type{<:QuantumObject{OperatorKet,N}}) where {N} = true
isoperket(A::QuantumObject{OperatorKet}) = true
isoperket(A) = false # default case

@doc raw"""
issuper(A)

Checks if the [`AbstractQuantumObject`](@ref) `A` is a [`SuperOperator`](@ref). Default case returns `false` for any other inputs.
"""
issuper(A::AbstractQuantumObject) = issuper(typeof(A))
issuper(::Type{<:AbstractQuantumObject{<:SuperOperatorType,N}}) where {N} = true
issuper(A::AbstractQuantumObject{<:SuperOperatorType}) = true
issuper(A) = false # default case

@doc raw"""
Expand Down
2 changes: 1 addition & 1 deletion src/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Add multiple points to the Bloch sphere visualization.
"""
function add_points!(
b::Bloch,
pnts::Matrix{<:Real};
pnts::AbstractMatrix{<:Real};
meth::Symbol = :s,
color::Union{Nothing,String} = nothing,
alpha::Float64 = 1.0,
Expand Down
Loading