# SciMLOperators "\*" function for TransposedOperator

**URL:** https://discourse.julialang.org/t/scimloperators-function-for-transposedoperator/129422
**Category:** Optimization (Mathematical)
**Tags:** question, sciml
**Created:** [May 28, 2025, 10:33pm UTC](https://discourse.julialang.org/t/scimloperators-function-for-transposedoperator/129422 "2025-05-28T22:33:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![fdekerme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fdekerme/32/43574_2.png) [@fdekerme](https://discourse.julialang.org/u/fdekerme)
#### Post date: [May 28, 2025, 10:33pm UTC](https://discourse.julialang.org/t/scimloperators-function-for-transposedoperator/129422/1 "2025-05-28T22:33:38Z")

</div>

Hello 😀,  
I want to use SciMLOperators.jl with LinearSolve.jl to solve a linear system like

\left( A^T V^{-1} A + \lambda (W - I)^T (W - I) \right) x = A^T V^{-1} \mu 

I created a `FunctionOperator` for `A`, `V_inv`, `W` and `I` named `mfopA`,`mfopV`, `mfopW` and `mfopId` respectively. I would like to combine them like (right term):

```julia
R = cache_operator(transpose(mfopW - mfopId) * (mfopW - mfopId), L)
A = cache_operator(transpose(mfopA) * mfopV * mfopA + λ * R, L)

```

However, when I try `A * L`, I have the following error:

```julia
 MethodError: no method matching *(::SciMLOperators.TransposedOperator{Float64, FunctionOperator{…}}, ::Vector{Float64})
The function `*` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  *(::Any, ::Any, ::Any, ::Any...)
   @ Base operators.jl:596
  *(::Type{<:ProdOp}, ::Any, ::Any)
   @ LinearOperatorCollection ~/.julia/packages/LinearOperatorCollection/qbON0/src/ProdOp.jl:73
  *(::ChainRulesCore.NoTangent, ::Any)
   @ ChainRulesCore ~/.julia/packages/ChainRulesCore/U6wNx/src/tangent_arithmetic.jl:64
  ...

Stacktrace:
  [1] (::SciMLOperators.var"#175#176"{Vector{…}})(op::SciMLOperators.TransposedOperator{Float64, FunctionOperator{…}})
    @ SciMLOperators ~/.julia/packages/SciMLOperators/diVke/src/basic.jl:588
  [2] MappingRF
    @ ./reduce.jl:100 [inlined]
  [3] afoldl(::Base.MappingRF{…}, ::Base._InitialValue, ::SciMLOperators.TransposedOperator{…}, ::SciMLOperators.ScaledOperator{…})
    @ Base ./operators.jl:553
  [4] _foldl_impl(op::Base.MappingRF{…}, init::Base._InitialValue, itr::Tuple{…})
    @ Base ./reduce.jl:68
  [5] foldl_impl(op::Base.MappingRF{…}, nt::Base._InitialValue, itr::Tuple{…})
    @ Base ./reduce.jl:48
  [6] mapfoldl_impl(f::SciMLOperators.var"#175#176"{…}, op::typeof(Base.add_sum), nt::Base._InitialValue, itr::Tuple{…})
    @ Base ./reduce.jl:44
  [7] mapfoldl(f::Function, op::Function, itr::Tuple{…}; init::Base._InitialValue)
    @ Base ./reduce.jl:175
  [8] mapfoldl
    @ ./reduce.jl:175 [inlined]
  [9] mapreduce
    @ ./reduce.jl:307 [inlined]
 [10] sum(f::Function, a::Tuple{SciMLOperators.TransposedOperator{…}, SciMLOperators.ScaledOperator{…}})
    @ Base ./reduce.jl:532
 [11] *(L::SciMLOperators.AddedOperator{Float64, Tuple{…}}, v::Vector{Float64})
    @ SciMLOperators ~/.julia/packages/SciMLOperators/diVke/src/basic.jl:588
 [12] top-level scope
    @ REPL[140]:1
Some type information was truncated. Use `show(err)` to see complete types.

```

Thanks!  
fdekerm

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [May 28, 2025, 11:58pm UTC](https://discourse.julialang.org/t/scimloperators-function-for-transposedoperator/129422/2 "2025-05-28T23:58:47Z")

</div>

Open an issue. It’s a missing dispatch.

---

<div class="post-metadata">

### Author: ![fdekerme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fdekerme/32/43574_2.png) [@fdekerme](https://discourse.julialang.org/u/fdekerme)
#### Post date: [May 29, 2025, 1:55am UTC](https://discourse.julialang.org/t/scimloperators-function-for-transposedoperator/129422/3 "2025-05-29T01:55:57Z")

</div>

Thanks!

> <https://github.com/SciML/SciMLOperators.jl/issues/282>
>
> Hello,
> https://discourse.julialang.org/t/scimloperators-function-for-transposedo…perator/129422
> 
> The dispatch of multiplication (\*) for TransposedOperator is missing:
> 
> \`\`\`julia
> function Afunc!(w,v,u,p,t)
> w\[1\] = -2v\[1\] + v\[2\]
> for i in 2:4
> w\[i\] = v\[i-1\] - 2v\[i\] + v\[i+1\]
> end
> w\[5\] = v\[4\] - 2v\[5\]
> nothing
> end
> 
> function Afunc!(v,u,p,t)
> w = zeros(5)
> Afunc!(w,v,u,p,t)
> w
> end
> 
> mfopA = FunctionOperator(Afunc!, zeros(5), zeros(5))
> mfopA\_t = transpose(mfopA)
> mfopA \* rand(5)
> mfopA\_t \* rand(5)\`
> 
> \`\`\`
> 
> SciMLOperators v1.3.0
> Julia 1.11.5
> 
> Thanks
