cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
is_unitary.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_IS_UNITARY_H
4#define pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_IS_UNITARY_H
5
9
10namespace pRC
11{
12 template<class X, IsTensorish R = RemoveReference<X>, IsValue TT = Value<R>>
13 requires IsInvocable<Adjoint, X>
14 static inline constexpr auto isUnitary(X &&a,
15 TT const &tolerance = NumericLimits<TT>::tolerance())
16 {
17 return isIdentity(adjoint(a) * a, tolerance);
18 }
19}
20#endif // pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_IS_UNITARY_H
Definition cholesky.hpp:10
static constexpr auto adjoint(JacobiRotation< T > const &a)
Definition jacobi_rotation.hpp:312
static constexpr auto isIdentity(T const a)
Definition is_identity.hpp:11
static constexpr auto isUnitary(X &&a, TT const &tolerance=NumericLimits< TT >::tolerance())
Definition is_unitary.hpp:14
Definition limits.hpp:13