From d5a211e942e35c7e36ad2cb6b72be9b521b28d21 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Tue, 30 Jan 2024 12:02:12 +0800 Subject: [PATCH] implement YaoAPI interfaces: apply_mat! and mat_back! --- lib/YaoBlocks/src/YaoBlocks.jl | 4 +++- lib/YaoBlocks/src/autodiff/autodiff.jl | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/YaoBlocks/src/YaoBlocks.jl b/lib/YaoBlocks/src/YaoBlocks.jl index 2be4c067..28149d8b 100644 --- a/lib/YaoBlocks/src/YaoBlocks.jl +++ b/lib/YaoBlocks/src/YaoBlocks.jl @@ -51,7 +51,9 @@ import YaoAPI: subblocks, nparameters, measure!, - measure + measure, + apply_back!, + mat_back! export AbstractBlock, AbstractContainer, diff --git a/lib/YaoBlocks/src/autodiff/autodiff.jl b/lib/YaoBlocks/src/autodiff/autodiff.jl index 7cbf3b93..a77e0302 100644 --- a/lib/YaoBlocks/src/autodiff/autodiff.jl +++ b/lib/YaoBlocks/src/autodiff/autodiff.jl @@ -15,6 +15,7 @@ using BitBasis, YaoArrayRegister, YaoAPI using ..YaoBlocks import ChainRulesCore: rrule, @non_differentiable, NoTangent, Tangent, backing, AbstractTangent, ZeroTangent +import YaoAPI: mat_back!, apply_back! using SparseArrays, LuxurySparse, LinearAlgebra include("NoParams.jl")