You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioncheck_mul_dimensions(from::NTuple{NA,AbstractSpace}, to::NTuple{NB,AbstractSpace}) where {NA,NB}
54
-
(from != to) &&throw(
55
-
DimensionMismatch(
56
-
"The quantum object with (right) dims = $(dimensions_to_dims(from)) can not multiply a quantum object with (left) dims = $(dimensions_to_dims(to)) on the right-hand side.",
functioncheck_mul_dimensions(from::NTuple{NA,AbstractSpace}, to::NTuple{NB,AbstractSpace}) where {NA,NB}
100
+
(from != to) &&throw(
101
+
DimensionMismatch(
102
+
"The quantum object with (right) dims = $(dimensions_to_dims(from)) can not multiply a quantum object with (left) dims = $(dimensions_to_dims(to)) on the right-hand side.",
103
+
),
104
+
)
105
+
returnnothing
106
+
end
107
+
127
108
Base.:(^)(A::QuantumObject, n::T) where {T<:Number} =QuantumObject(^(A.data, n), A.type, A.dimensions)
128
109
Base.:(/)(A::AbstractQuantumObject, n::T) where {T<:Number} =get_typename_wrapper(A)(A.data / n, A.type, A.dimensions)
@@ -530,7 +532,7 @@ Generates a discrete Fourier transform matrix ``\hat{F}_N`` for [Quantum Fourier
530
532
531
533
The `dimensions` can be either the following types:
532
534
- `dimensions::Int`: Number of basis states in the Hilbert space.
533
-
- `dimensions::Union{Dimensions,AbstractVector{Int},Tuple}`: list of dimensions representing the each number of basis in the subsystems.
535
+
- `dimensions::Union{AbstractDimensions,AbstractVector{Int},Tuple}`: list of dimensions representing the each number of basis in the subsystems.
534
536
535
537
``N`` represents the total dimension, and therefore the matrix is defined as
536
538
@@ -551,8 +553,8 @@ where ``\omega = \exp(\frac{2 \pi i}{N})``.
551
553
It is highly recommended to use `qft(dimensions)` with `dimensions` as `Tuple` or `SVector` from [StaticArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) to keep type stability. See the [related Section](@ref doc:Type-Stability) about type stability for more details.
0 commit comments