Skip to content

Conversation

fatteneder
Copy link
Contributor

Fixes the following MWEs

using TensorOperations
const TO = TensorOperations

function test(ex)
    @show ex
    @show TO.isgeneraltensor(ex)
    try
        @show TO.decomposegeneraltensor(ex)
    catch e
        @show e
    end
    println()
end

test(:(a * A[i,j] * a))
test(:(a * a * A[i,j]))

Current main:

julia> include("mwe.jl")
ex = :(a * A[i, j] * a)
TO.isgeneraltensor(ex) = true
e = ArgumentError("not a valid generalized tensor expression a * A[i, j] * a")

ex = :(a * a * A[i, j])
TO.isgeneraltensor(ex) = true
e = ArgumentError("not a valid generalized tensor expression a * a * A[i, j]")

This PR:

julia> include("mwe.jl")
ex = :(a * A[i, j] * a)
TO.isgeneraltensor(ex) = true
TO.decomposegeneraltensor(ex) = (:A, Any[:i, :j], Any[], :(a * true * a), false)

ex = :(a * a * A[i, j])
TO.isgeneraltensor(ex) = true
TO.decomposegeneraltensor(ex) = (:A, Any[:i, :j], Any[], :(a * a * true), false)

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #131 (6098d35) into master (7181632) will increase coverage by 0.50%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   77.12%   77.63%   +0.50%     
==========================================
  Files          22       22              
  Lines        1985     1985              
==========================================
+ Hits         1531     1541      +10     
+ Misses        454      444      -10     
Impacted Files Coverage Δ
src/indexnotation/analyzers.jl 85.90% <100.00%> (+4.69%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Jutho Jutho merged commit 8f411fb into QuantumKitHub:master Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants