We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running the current version Deutsch-Josza algorithm with >21Q gives an error
----> 1 cir = dj_benchmark.DeutschJozsa(22, 'constant_circuit') 2 transpile(cir, basis_gates=['x', 'sx', 'rz', 'cx'], optimization_level=3).draw() File c:\Users\2J7579897\Notebooks_general\QEDC-benchmark\QC-App-Oriented-Benchmarks\deutsch-jozsa/qiskit\dj_benchmark.py:93, in DeutschJozsa(num_qubits, type) 91 # Add a constant or balanced oracle function 92 if type == 0: Uf = constant_oracle(input_size, num_qubits) ---> 93 else: Uf = balanced_oracle(input_size, num_qubits) 94 qc.append(Uf, qr) 96 qc.barrier() File c:\Users\2J7579897\Notebooks_general\QEDC-benchmark\QC-App-Oriented-Benchmarks\deutsch-jozsa/qiskit\dj_benchmark.py:54, in balanced_oracle(input_size, num_qubits) 52 b_str = "10101010101010101010" # permit input_string up to 20 chars 53 for qubit in range(input_size): ---> 54 if b_str[qubit] == '1': 55 qc.x(qubit) 57 qc.barrier() IndexError: string index out of range
Possible Fixes:
b_str
dj_benchmark.py
The text was updated successfully, but these errors were encountered:
Fix for Issue #429 - remove error in Deutsch-Jozsa if num_qubits > 20
f30421c
This issue has been fixed. We now create a dynamic bit string b_str depending on num_qubits
Sorry, something went wrong.
Closed. This issue has been fixed. We now create a dynamic bit string b_str depending on num_qubits.
No branches or pull requests
Running the current version Deutsch-Josza algorithm with >21Q gives an error
Possible Fixes:
b_str
indj_benchmark.py
by a few more charactersb_str
depending on qubit number/ max qubit numberThe text was updated successfully, but these errors were encountered: