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
* lazy ket implementation
* expect() and test
* Rebase master, rename & add some multiplication methods
* Fix expect method with LazyTensor and LazyKets
* Update version
* Skip broken tests on 1.6
* Bump JET failures
* Actually bump jet limit
---------
Co-authored-by: Christoph <[email protected]>
Co-authored-by: David Plankensteiner <[email protected]>
Co-authored-by: David Plankensteiner <[email protected]>
for (factor, sub_op) inzip(op.factors, op.operators)
114
+
exp_val += factor *expect(sub_op, state)
115
+
end
116
+
117
+
return exp_val
118
+
end
119
+
120
+
121
+
# mul! with lazytensor -- needed to compute lazyproduct averages (since ⟨op1 * op2⟩ doesn't factorize)
122
+
# this mul! is the only one that really makes sense
123
+
functionmul!(y::LazyKet{BL}, op::LazyOperator{BL,BR}, x::LazyKet{BR}) where {BL, BR}
124
+
T =promote_type(eltype(y), eltype(op), eltype(x))
125
+
mul!(y, op, x, one(T), zero(T))
126
+
end
127
+
functionmul!(y::LazyKet{BL}, op::LazyTensor{BL, BR}, x::LazyKet{BR}, alpha, beta) where {BL, BR}
128
+
iszero(beta) ||throw("Error: cannot perform muladd operation on LazyKets since addition is not implemented. Convert them to dense kets using Ket(x) in order to perform muladd operations.")
0 commit comments