@@ -167,49 +167,49 @@ check_dimensions(Qobj_tuple::NTuple{N,AbstractQuantumObject}) where {N} =
167167 check_dimensions (getfield .(Qobj_tuple, :dimensions ))
168168check_dimensions (A:: AbstractQuantumObject... ) = check_dimensions (A)
169169
170- function _check_QuantumObject (type:: KetQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
170+ function _check_QuantumObject (type:: KetQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
171171 (n != 1 ) && throw (DomainError ((m, n), " The size of the array is not compatible with Ket" ))
172- (prod (dims ) != m) && throw (DimensionMismatch (" Ket with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
172+ (prod (dimensions ) != m) && throw (DimensionMismatch (" Ket with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
173173 return nothing
174174end
175175
176- function _check_QuantumObject (type:: BraQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
176+ function _check_QuantumObject (type:: BraQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
177177 (m != 1 ) && throw (DomainError ((m, n), " The size of the array is not compatible with Bra" ))
178- (prod (dims ) != n) && throw (DimensionMismatch (" Bra with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
178+ (prod (dimensions ) != n) && throw (DimensionMismatch (" Bra with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
179179 return nothing
180180end
181181
182- function _check_QuantumObject (type:: OperatorQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
183- L = prod (dims )
184- (L == m == n) || throw (DimensionMismatch (" Operator with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
182+ function _check_QuantumObject (type:: OperatorQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
183+ L = prod (dimensions )
184+ (L == m == n) || throw (DimensionMismatch (" Operator with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
185185 return nothing
186186end
187187
188- function _check_QuantumObject (type:: OperatorQuantumObject , dims :: GeneralDimensions , m:: Int , n:: Int )
188+ function _check_QuantumObject (type:: OperatorQuantumObject , dimensions :: GeneralDimensions , m:: Int , n:: Int )
189189 ((m == 1 ) || (n == 1 )) && throw (DomainError ((m, n), " The size of the array is not compatible with Operator" ))
190- ((prod (dims . to) != m) || (prod (dims . from) != n)) &&
191- throw (DimensionMismatch (" Operator with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
190+ ((prod (dimensions . to) != m) || (prod (dimensions . from) != n)) &&
191+ throw (DimensionMismatch (" Operator with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
192192 return nothing
193193end
194194
195- function _check_QuantumObject (type:: SuperOperatorQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
195+ function _check_QuantumObject (type:: SuperOperatorQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
196196 (m != n) && throw (DomainError ((m, n), " The size of the array is not compatible with SuperOperator" ))
197- (prod (dims ) != sqrt (m)) &&
198- throw (DimensionMismatch (" SuperOperator with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
197+ (prod (dimensions ) != sqrt (m)) &&
198+ throw (DimensionMismatch (" SuperOperator with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
199199 return nothing
200200end
201201
202- function _check_QuantumObject (type:: OperatorKetQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
202+ function _check_QuantumObject (type:: OperatorKetQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
203203 (n != 1 ) && throw (DomainError ((m, n), " The size of the array is not compatible with OperatorKet" ))
204- (prod (dims ) != sqrt (m)) &&
205- throw (DimensionMismatch (" OperatorKet with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
204+ (prod (dimensions ) != sqrt (m)) &&
205+ throw (DimensionMismatch (" OperatorKet with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
206206 return nothing
207207end
208208
209- function _check_QuantumObject (type:: OperatorBraQuantumObject , dims :: Dimensions , m:: Int , n:: Int )
209+ function _check_QuantumObject (type:: OperatorBraQuantumObject , dimensions :: Dimensions , m:: Int , n:: Int )
210210 (m != 1 ) && throw (DomainError ((m, n), " The size of the array is not compatible with OperatorBra" ))
211- (prod (dims ) != sqrt (n)) &&
212- throw (DimensionMismatch (" OperatorBra with dims = $(dims ) does not fit the array size = $((m, n)) ." ))
211+ (prod (dimensions ) != sqrt (n)) &&
212+ throw (DimensionMismatch (" OperatorBra with dims = $(_get_dims_string (dimensions) ) does not fit the array size = $((m, n)) ." ))
213213 return nothing
214214end
215215
0 commit comments