Skip to content

Allow inserting multiqubit operations in qml.transforms.insert #1877

Description

@trbromley

Feature details

The qml.transforms.insert() transform was recently added in #1795, allowing users to insert a specified single qubit gate into a circuit with three orientations:

  • at the start of the circuit
  • at the end of the circuit
  • after every gate in the circuit

However, it might also be nice to have the option of inserting multiqubit gates.

For example, what if we know that a CRX gate always adds a small additional CRY rotation.

Implementation

The main question is how we should support inserting an N-qubit operation onto an M-qubit operation when N may not be equal to M.

My suggestion would be to add the feature in #1876 first and then only allow inserting multiqubit gates onto specified gates, checking that the specified gates are of the same qubit number.

How important would you say this feature is?

1: Not important. Would be nice to have.

Additional information

Discussed here: #1795 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions