Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QCircuit.CTRL() with multiple targets throws "qpp::applyCTRL(): Matrix mismatch subsystems! [A/target]" #130

Closed
antoine-bussy opened this issue Sep 18, 2022 · 4 comments

Comments

@antoine-bussy
Copy link
Contributor

Hi,

Executing the following circuit

auto const circuit = qpp::QCircuit{ 3u } .CTRL(qpp::gt.X, { 0u }, { 1u, 2u });

throws "qpp::applyCTRL(): Matrix mismatch subsystems! [A/target]"

I've implemented a unit test: antoine-bussy@fd15ca8
I suspect that is treated as a CTRL_joint in QEngine::execute.

@antoine-bussy
Copy link
Contributor Author

Replacing U with kronpow(U, target.size()) fixes the issue. See antoine-bussy@6da00f5
But I guess it's not a very good fix performance-wise.

@antoine-bussy
Copy link
Contributor Author

The documentation of QCircuit::CTRL states that U is a single qubit gate, unlike QCircuit::CTRL_joint.
Have I misunderstood the issue #97 ?

@vsoftco
Copy link
Member

vsoftco commented Sep 19, 2022

I see now the overload you're referring to... will check

@vsoftco
Copy link
Member

vsoftco commented Mar 1, 2023

Fixed by #135

@vsoftco vsoftco closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants