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

Oracle synthesis: verilog array format? #48

Open
gribeill opened this issue Apr 13, 2022 · 1 comment
Open

Oracle synthesis: verilog array format? #48

gribeill opened this issue Apr 13, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@gribeill
Copy link

I'm wondering if the Verilog oracle synthesis syntax supports vectors as inputs/outputs?

Minimal example:

Oracle declaration:

module oracle (a, b, c);
	input [1:0] a;
	input [1:0] b;
	output c;
        //random example function
	assign c = (a[0] & b[1]) ^ (a[1] & b[0]);
endmodule

With QASM:

OPENQASM 2.0;
include "qelib1.inc";

oracle test a, b, c { "reg_oracle.v" }

qreg a[2];
qreg b[2];
qreg c[1];

test a, b, c;

gives a compiler error:

test_oracle.qasm:10:10: Register c has incompatible length

Thanks!

@meamy
Copy link
Collaborator

meamy commented Apr 13, 2022

Currently it can not. This is due to a limitation of the openQASM 2.0 language, which will (hopefully) be fixed in openQASM 3.0 (issue #323), where gates can only take individual qubits as parameters.

Thanks! Leaving this open as an enhancement for now, but if there are other missing features of Verilog that would be useful feel free to open up a separate feature request.

@meamy meamy added the enhancement New feature or request label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants