Class CProduct¶
Defined in File expr.hpp
Inheritance Relationships¶
Base Type¶
public sequant::Product
(Class Product)
Class Documentation¶
-
class CProduct : public sequant::Product¶
Public Functions
-
inline virtual bool is_commutative() const override¶
checks commutativity recursively
See also
Note
this is memoizing
- Returns:
true if definitely commutative, false definitely not commutative
-
virtual void adjoint() override¶
adjoint of a CProduct is a product of adjoints of its factors, with complex-conjugated scalar
Note
factors are not reversed since the factors commute
-
Product() = default¶
-
inline Product(ExprPtrList factors, Flatten flatten_tag = Flatten::Yes)¶
construct a Product out of zero or more factors (multiplied by 1)
- Parameters:
factors – the factors
flatten_tag – if Flatten::Yes, flatten the factors
-
template<typename Range, typename = std::enable_if_t<meta::is_range_v<std::decay_t<Range>> && !meta::is_same_v<Range, ExprPtrList> && !meta::is_same_v<Range, Product>>>
inline explicit Product(Range &&rng, Flatten flatten_tag = Flatten::Yes)¶ construct a Product out of zero or more factors (multiplied by 1)
- Parameters:
rng – a range of factors
flatten_tag – if Flatten::Yes, flatten the factors
-
template<typename T, typename Range, typename = std::enable_if_t<meta::is_range_v<std::decay_t<Range>> && !std::is_same_v<std::remove_reference_t<Range>, ExprPtrList> && !std::is_same_v<std::remove_reference_t<Range>, Product>>>
inline explicit Product(T scalar, Range &&rng, Flatten flatten_tag = Flatten::Yes)¶ construct a Product out of zero or more factors (multiplied by 1)
- Template Parameters:
T – a numeric type; it must be able to multiply Product::scalar_type
- Parameters:
scalar – a scalar of type T
rng – a range of factors
flatten_tag – if Flatten::Yes, flatten the factors
-
template<typename T>
inline Product(T scalar, ExprPtrList factors, Flatten flatten_tag = Flatten::Yes)¶ construct a Product out of zero or more factors multiplied by a scalar
- Template Parameters:
T – a numeric type; it must be able to multiply Product::scalar_type
- Parameters:
scalar – a scalar of type T
factors – an initializer list of factors
flatten_tag – if Flatten::Yes, flatten the factors
-
template<typename Iterator>
inline Product(Iterator begin, Iterator end, Flatten flatten_tag = Flatten::Yes)¶ construct a Product out of a range of factors
- Parameters:
begin – the begin iterator
end – the end iterator
flatten_tag – specifies whether (and how) to flatten the argument(s)
-
template<typename T, typename Iterator>
inline Product(T scalar, Iterator begin, Iterator end, Flatten flatten_tag = Flatten::Yes)¶ construct a Product out of a range of factors
- Template Parameters:
T – a numeric type; it must be able to multiply Product::scalar_type
- Parameters:
scalar – a scalar of type T
begin – the begin iterator
end – the end iterator
flatten_tag – specifies whether (and how) to flatten the argument(s)
-
inline virtual bool is_commutative() const override¶