Skip to content

compute hessian matrix of circuit #263

Closed
QuantumBFS/YaoBlocks.jl
#150
@yuyuexi

Description

@yuyuexi

when I used Zygote.hessian to compute the hessian matrix of a circuit, i.e Zygote.hessian(f, params), where params are parameters of a variational circuit and f(params) is a real number, I got a MethodError whose message is below.
Screen Shot 2020-12-01 at 13 18 30

It seems that when ForwardDiff use Dual to compute the jacobian matrix, the Dual type is not supported by RotationGate in this circuit. So how can I compute hessian of my real-value function f?

(just for example: f(params) = operator_fidelity(target_unitary, dispatch!(circuit, params)) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions