Skip to content

Commit b2c90b5

Browse files
Run code-quality CI also on Julia 1 (#401)
Co-authored-by: Alberto Mercurio <[email protected]>
1 parent 64a727c commit b2c90b5

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

.github/workflows/Code-Quality.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
matrix:
4141
version:
4242
- 'lts'
43+
- '1'
4344
os:
4445
- 'ubuntu-latest'
4546
arch:

src/qobj/boolean_functions.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,47 @@ export isunitary
1010
1111
Checks if the [`QuantumObject`](@ref) `A` is a [`Bra`](@ref). Default case returns `false` for any other inputs.
1212
"""
13-
isbra(A::QuantumObject) = isbra(typeof(A))
14-
isbra(::Type{<:QuantumObject{Bra,N}}) where {N} = true
13+
isbra(A::QuantumObject{Bra}) = true
1514
isbra(A) = false # default case
1615

1716
@doc raw"""
1817
isket(A)
1918
2019
Checks if the [`QuantumObject`](@ref) `A` is a [`Ket`](@ref). Default case returns `false` for any other inputs.
2120
"""
22-
isket(A::QuantumObject) = isket(typeof(A))
23-
isket(::Type{<:QuantumObject{Ket,N}}) where {N} = true
21+
isket(A::QuantumObject{Ket}) = true
2422
isket(A) = false # default case
2523

2624
@doc raw"""
2725
isoper(A)
2826
2927
Checks if the [`AbstractQuantumObject`](@ref) `A` is a [`Operator`](@ref). Default case returns `false` for any other inputs.
3028
"""
31-
isoper(A::AbstractQuantumObject) = isoper(typeof(A))
32-
isoper(::Type{<:AbstractQuantumObject{Operator,N}}) where {N} = true
29+
isoper(A::AbstractQuantumObject{Operator}) = true
3330
isoper(A) = false # default case
3431

3532
@doc raw"""
3633
isoperbra(A)
3734
3835
Checks if the [`QuantumObject`](@ref) `A` is a [`OperatorBra`](@ref). Default case returns `false` for any other inputs.
3936
"""
40-
isoperbra(A::QuantumObject) = isoperbra(typeof(A))
41-
isoperbra(::Type{<:QuantumObject{OperatorBra,N}}) where {N} = true
37+
isoperbra(A::QuantumObject{OperatorBra}) = true
4238
isoperbra(A) = false # default case
4339

4440
@doc raw"""
4541
isoperket(A)
4642
4743
Checks if the [`QuantumObject`](@ref) `A` is a [`OperatorKet`](@ref). Default case returns `false` for any other inputs.
4844
"""
49-
isoperket(A::QuantumObject) = isoperket(typeof(A))
50-
isoperket(::Type{<:QuantumObject{OperatorKet,N}}) where {N} = true
45+
isoperket(A::QuantumObject{OperatorKet}) = true
5146
isoperket(A) = false # default case
5247

5348
@doc raw"""
5449
issuper(A)
5550
5651
Checks if the [`AbstractQuantumObject`](@ref) `A` is a [`SuperOperator`](@ref). Default case returns `false` for any other inputs.
5752
"""
58-
issuper(A::AbstractQuantumObject) = issuper(typeof(A))
59-
issuper(::Type{<:AbstractQuantumObject{<:SuperOperatorType,N}}) where {N} = true
53+
issuper(A::AbstractQuantumObject{<:SuperOperatorType}) = true
6054
issuper(A) = false # default case
6155

6256
@doc raw"""

src/visualization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Add multiple points to the Bloch sphere visualization.
235235
"""
236236
function add_points!(
237237
b::Bloch,
238-
pnts::Matrix{<:Real};
238+
pnts::AbstractMatrix{<:Real};
239239
meth::Symbol = :s,
240240
color::Union{Nothing,String} = nothing,
241241
alpha::Float64 = 1.0,

0 commit comments

Comments
 (0)