PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.34k stars 602 forks source link

Add Integer Comparision template #2887

Closed ankit27kh closed 2 years ago

ankit27kh commented 2 years ago

Feature details

Add a template that can compare a provided integer $L$ with a basis state $\left|i\right>_n$ and flip a target qubit if $i\ge L$ or $i < L$ depending on a user-defined parameter: $\left|i\right>_n\left|0\right>\rightarrow\left|i\right>_n\left|i\ge L\right>$

Implementation

This is available in Qiskit here.

How important would you say this feature is?

2: Somewhat important. Needed this quarter.

Additional information

No response

isaacdevlugt commented 2 years ago

Hey @ankit27kh ! Thanks for your issue 😄

isaacdevlugt commented 2 years ago

@ankit27kh this operator should be available in the next PennyLane release! 🎉