Skip to content

Performance bottleneck when computing expectation values with default.clifford #9015

@JeremieGince

Description

@JeremieGince

Hi,

I am the creator of MatchCake, a free-fermions simulator built on top of PennyLane. As part of my simulations, I rely on a Clifford-based subroutine to compute expectation values using PennyLane’s default.clifford device.

This subroutine is implemented here:
https://github.com/MatchCake/MatchCake/blob/864063be8bece84d0238fbfc648e1fd2e1ecacb9/src/matchcake/devices/expval_strategies/clifford_expval/clifford_expval_strategy.py#L26.

While profiling MatchCake within another project, I noticed that this subroutine is a significant performance bottleneck. In particular, computing expectation values via DefaultClifford._measure_expectation appears to take substantially more time than expected.

I wanted to ask whether you have any suggestions for optimizing this workflow. Maybe there is a way to batch the expectation value observables for instance?

This may, in a way, be related to the following issue: #8946.

Thank you very much for your time and insights.

Best regards,
Jérémie Gince

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