Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
17
19
description
stringlengths
141
397
entry_point
stringlengths
3
46
test_call
stringlengths
110
393
qiskitHumanEval/4
Write the function that converts the matrix [[0, 0, 0, 1],[0, 0, 1, 0],[1, 0, 0, 0],[0, 1, 0, 0]] into a unitary gate and apply it to a Quantum Circuit. Then return the circuit. You must implement this using a function named `create_unitary_from_matrix` with no arguments.
create_unitary_from_matrix
from qiskit import QuantumCircuit result = create_unitary_from_matrix() assert isinstance(result, QuantumCircuit) assert result.num_qubits == 2 assert len(result.data) > 0
qiskitHumanEval/7
Generate a 1 qubit QuantumCircuit with a parametrized Rx gate with parameter "theta". You must implement this using a function named `create_parametrized_gate` with no arguments.
create_parametrized_gate
circuit = create_parametrized_gate() assert circuit.num_qubits == 1 assert circuit.data[0].operation.name == "rx" assert circuit.data[0].operation.params[0].name == "theta"
qiskitHumanEval/8
Return a 1-qubit QuantumCircuit with a parametrized Rx gate and parameter "theta". If value is not None, return the circuit with value assigned to theta. You must implement this using a function named `rx_gate` with the following arguments: value.
rx_gate
circuit = rx_gate() assert circuit.num_qubits == 1 assert circuit.data[0].operation.name == "rx" assigned = rx_gate(value=1.0) assert assigned.num_qubits == 1 assert assigned.num_parameters == 0
qiskitHumanEval/10
Create a Qiskit circuit with the following unitary [[0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0], [1, 0, 0, 0]], consisting of only single-qubit gates and CX gates, then transpile the circuit using pass manager with optimization level as 1. You must implement this using a function named `create_operator` with no arguments.
create_operator
from qiskit import QuantumCircuit result = create_operator() assert isinstance(result, QuantumCircuit) assert result.num_qubits == 2 for inst in result.data: if inst.operation.num_qubits > 1: assert inst.operation.name in ["cx", "barrier"]
qiskitHumanEval/38
Build a 2-qubit Quantum Circuit composed by H gate in Quantum register 0, Controlled-RZ gate in quantum register 0 1 with given input theta value, H gate in quantum register 1 and Controlled-RY gate in quantum register 1 0 with given input theta value. You must implement this using a function named `create_quantum_circ...
create_quantum_circuit_based_h0_crz01_h1_cry10
from math import pi from qiskit import QuantumCircuit result = create_quantum_circuit_based_h0_crz01_h1_cry10(pi / 2) assert isinstance(result, QuantumCircuit) assert result.num_qubits == 2 assert len(result.data) >= 4
qiskitHumanEval/44
Write an example using Qiskit that performs tensor operation on a 1-qubit quantum circuit with an X gate and a 2-qubit quantum circuit with a CRY gate, where the CRY gate has an angle of 0.2 radians and is controlled by qubit 0. You must implement this using a function named `tensor_circuits` with no arguments.
tensor_circuits
from qiskit import QuantumCircuit result = tensor_circuits() assert isinstance(result, QuantumCircuit) assert result.num_qubits == 3 assert len(result.data) > 0
qiskitHumanEval/1
Define a phi plus bell state using Qiskit, transpile the circuit using pass manager with optimization level as 1, run it using Qiskit Sampler with the Aer simulator as backend and return the counts dictionary. You must implement this using a function named `run_bell_state_simulator` with no arguments.
run_bell_state_simulator
result = run_bell_state_simulator() assert isinstance(result, dict) assert len(result) > 0 assert set(result.keys()).issubset({"00", "11"})
qiskitHumanEval/14
Run a phi plus Bell circuit using Qiskit Sampler with the Aer simulator as backend for 100 shots and return measurement results for each shots. To do so, transpile the circuit using a pass manager with optimization level as 1. You must implement this using a function named `bell_each_shot` with no arguments.
bell_each_shot
result = bell_each_shot() assert isinstance(result, list) assert len(result) > 0 assert all(isinstance(x, str) for x in result)
qiskitHumanEval/31
Run a Bell circuit on Qiskit Sampler and run the circuit on the Aer simulator with the seed set as 42. Return the resulting counts dictionary. You must implement this using a function named `sampler_qiskit` with no arguments.
sampler_qiskit
result = sampler_qiskit() assert isinstance(result, dict) assert len(result) > 0 assert set(result.keys()).issubset({"00", "11"})
qiskitHumanEval/33
Generate two random quantum circuits, each with 2 qubits and a depth of 2, using seed values of 0 and 1 respectively. Run the circuits using the Sampler on the Aer simulator with the seed set as 42 and return the counts for both circuits. You must implement this using a function named `run_multiple_sampler` with no arg...
run_multiple_sampler
result = run_multiple_sampler() assert isinstance(result, list) assert len(result) == 2 for counts in result: assert isinstance(counts, dict) assert len(counts) > 0
qiskitHumanEval/48
Write a function that generates n number of random 8-bit unsigned integers using a Quantum Circuit and outputs a list of integers. You must implement this using a function named `random_number_generator_unsigned_8bit` with the following arguments: n.
random_number_generator_unsigned_8bit
result = random_number_generator_unsigned_8bit(10) assert isinstance(result, list) assert len(result) == 10 for value in result: assert isinstance(value, int) assert 0 <= value < 256
qiskitHumanEval/23
Create a constant oracle for use in a Deutsch-Jozsa experiment. The oracle takes two input bits (qubits 0 and 1) and writes to one output bit (qubit 2). You must implement this using a function named `dj_constant_oracle` with no arguments.
dj_constant_oracle
from qiskit import QuantumCircuit result = dj_constant_oracle() assert isinstance(result, QuantumCircuit) assert result.num_qubits == 3
qiskitHumanEval/24
Given a Deutsch-Jozsa oracle in which the final qubit is the "output" qubit, return True if the oracle is constant or False otherwise. You must implement this using a function named `dj_algorithm` with the following arguments: oracle.
dj_algorithm
from qiskit import QuantumCircuit balanced = QuantumCircuit(5) balanced.cx(3, 4) constant = QuantumCircuit(9) constant.x(8) result_balanced = dj_algorithm(balanced) result_constant = dj_algorithm(constant) assert isinstance(result_balanced, bool) assert isinstance(result_constant, bool)
qiskitHumanEval/36
Write a function to design a Bernstein-Vazirani oracle from a bitstring and return it. You must implement this using a function named `bv_function` with the following arguments: s.
bv_function
from qiskit import QuantumCircuit result = bv_function("1111") assert isinstance(result, QuantumCircuit) assert result.num_qubits == 5 assert result.count_ops().get("cx", 0) > 0
qiskitHumanEval/37
Illustrate a Bernstein-Vazirani algorithm routine on Qiskit and run it using Qiskit Sampler with Aer simulator as backend for a string of 0s and 1s. Return the bit strings of the result and the result itself. You must implement this using a function named `bv_algorithm` with the following arguments: s.
bv_algorithm
result = bv_algorithm("1111") assert isinstance(result, (list, tuple)) assert len(result) == 2 assert isinstance(result[0], list) assert result[1] is not None
qiskitHumanEval/52
Provide a quantum circuit that enables the transmission of two classical bits from the sender to the receiver through a single qubit of quantum communication, given that the sender and receiver have access to entangled qubits. You must implement this using a function named `send_bits` with the following arguments: bits...
send_bits
from qiskit import QuantumCircuit result_1 = send_bits("10") assert isinstance(result_1, QuantumCircuit) assert result_1.num_qubits == 2 result_2 = send_bits("01") assert isinstance(result_2, QuantumCircuit) assert result_2.num_qubits == 2
qiskitHumanEval/62
Construct a BB84 protocol circuit for the sender, inputting both the states and the measured bases. You must implement this using a function named `bb84_senders_circuit` with the following arguments: state, basis.
bb84_senders_circuit
from numpy.random import randint, seed from qiskit import QuantumCircuit seed(12345) qubits = 5 state = randint(2, size=qubits) basis = randint(2, size=qubits) result = bb84_senders_circuit(state, basis) assert isinstance(result, QuantumCircuit) assert result.num_qubits == qubits
qiskitHumanEval/63
Write a function to generate the key from the circuit and the sender's basis generated by the sender using BB84 protocol. You must implement this using a function named `bb84_circuit_generate_key` with the following arguments: senders_basis, circuit.
bb84_circuit_generate_key
from qiskit import QuantumCircuit basis = [1, 0, 0, 1, 1] circuit = QuantumCircuit(5) circuit.x([3, 4]) circuit.h([0, 3, 4]) result = bb84_circuit_generate_key(basis, circuit) assert isinstance(result, str) assert set(result).issubset({"0", "1"})
qiskitHumanEval/64
Write a function that takes the bitstring 's' as the input and builds a Quantum Circuit such that the output when xor-ed with the input 's' is same as the 's'. When building the quantum circuit make sure the classical registers is named 'c'. You must implement this using a function named `simons_algorithm` with the fol...
simons_algorithm
from qiskit import QuantumCircuit result = simons_algorithm("1010") assert isinstance(result, QuantumCircuit) assert result.num_qubits == 8 assert result.num_clbits >= 4
qiskitHumanEval/26
Construct a DAG circuit for a 3-qubit Quantum Circuit with the bell state applied on qubit 0 and 1. Finally return the DAG Circuit object. You must implement this using a function named `bell_dag` with no arguments.
bell_dag
from qiskit.dagcircuit import DAGCircuit result = bell_dag() assert isinstance(result, DAGCircuit) assert result.num_qubits() == 3 ops = dict(result.count_ops()) assert "h" in ops assert "cx" in ops
qiskitHumanEval/27
Generate a DAG circuit for 3-qubit Quantum Circuit which consists of H gate on qubit 0 and CX gate on qubit 0 and 1. After converting the circuit to DAG, apply a Hadamard operation to the back of qubit 0 and return the DAGCircuit. You must implement this using a function named `apply_op_back` with no arguments.
apply_op_back
from qiskit.dagcircuit import DAGCircuit result = apply_op_back() assert isinstance(result, DAGCircuit) assert result.num_qubits() == 3 assert result.depth() >= 2
qiskitHumanEval/50
Remove the gate in the input position for the given Quantum Circuit. You must implement this using a function named `remove_gate_in_position` with the following arguments: circuit, position.
remove_gate_in_position
from qiskit import QuantumCircuit qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1) qc.h(1) qc.h(0) result = remove_gate_in_position(qc, 0) assert isinstance(result, QuantumCircuit) assert result.num_qubits == 2 assert len(result.data) == 3
qiskitHumanEval/74
Split `circuit` at each barrier operation. Do not include barriers in the output circuits. You must implement this using a function named `split_circuit_at_barriers` with the following arguments: circuit.
split_circuit_at_barriers
from qiskit import QuantumCircuit qc = QuantumCircuit(3) qc.x(0) qc.barrier() qc.cx(0, 1) qc.h([0, 1]) qc.z(1) qc.barrier() qc.barrier() qc.tdg(0) circuits = split_circuit_at_barriers(qc) assert isinstance(circuits, list) assert len(circuits) == 4 for circuit in circuits: assert isinstance(circuit, QuantumCircuit) ...
qiskitHumanEval/95
For a given Quantum Circuit remove all the barriers from it and return. You must implement this using a function named `remove_barrier` with the following arguments: circuit.
remove_barrier
from qiskit import QuantumCircuit circuit = QuantumCircuit(1) circuit.h(0) circuit.barrier() circuit.x(0) candidate_circuit = remove_barrier(circuit) assert isinstance(candidate_circuit, QuantumCircuit) for inst in candidate_circuit.data: assert inst.operation.name != "barrier"
qiskitHumanEval/17
Unroll circuit for the gateset: CX, ID, RZ, SX, X, U. You must implement this using a function named `unroll_circuit` with the following arguments: circuit.
unroll_circuit
from qiskit import QuantumCircuit import numpy as np trial_circuit = QuantumCircuit(2) trial_circuit.h(0) trial_circuit.u(0.3, 0.1, 0.1, 1) trial_circuit.cp(np.pi / 4, 0, 1) trial_circuit.h(0) output = unroll_circuit(trial_circuit) assert isinstance(output, QuantumCircuit) for inst in output.data: assert inst.opera...
qiskitHumanEval/25
Transpile a 7-qubit GHZ circuit using LookaheadSwap pass and the input custom coupling map. You must implement this using a function named `passmanager_Lookahead` with the following arguments: coupling.
passmanager_Lookahead
from qiskit import QuantumCircuit from qiskit.transpiler import CouplingMap coupling = CouplingMap([[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6]]) result = passmanager_Lookahead(coupling) assert isinstance(result, QuantumCircuit) assert result.num_qubits == 7
qiskitHumanEval/76
Return a transpiler pass that replaces all non-controlled Z-gates with H-X-H-gate sequences. You must implement this using a function named `create_hxh_pass` with no arguments.
create_hxh_pass
from qiskit.transpiler.basepasses import TransformationPass hxh_pass = create_hxh_pass() if isinstance(hxh_pass, type): assert issubclass(hxh_pass, TransformationPass) else: assert isinstance(hxh_pass, TransformationPass)
qiskitHumanEval/86
Create a 5-qubit quantum circuit with a chain of CX gates and apply Qiskit's CollectLinearFunctions transpiler pass. Return two circuits: 1. One with no block width restriction. 2. One with a max_block_width of 3. Use PassManager to apply the pass and return both circuits. You must implement this using a function named...
collect_linear_blocks_with_and_without_limit
from qiskit import QuantumCircuit full, limited = collect_linear_blocks_with_and_without_limit() assert isinstance(full, QuantumCircuit) assert isinstance(limited, QuantumCircuit) assert full.num_qubits == 5 assert limited.num_qubits == 5
qiskitHumanEval/100
Create a pass manager to decompose the single qubit gates into gates of the dense subset ['t', 'tdg', 'h'] in the given circuit. You must implement this using a function named `sol_kit_decomp` with the following arguments: circuit.
sol_kit_decomp
from qiskit import QuantumCircuit import numpy as np circ = QuantumCircuit(3) circ.h(0) circ.rx(np.pi / 7, 1) circ.ry(np.pi / 5, 2) circ.cx(0, 1) circ.rz(np.pi / 3, 1) circ.s(2) circ.t(0) circ_can = sol_kit_decomp(circ) assert isinstance(circ_can, QuantumCircuit) assert circ_can.num_qubits == circ.num_qubits
qiskitHumanEval/113
Remove barriers from the given quantum circuit and calculate the depth before and after removal. Return a PropertySet with 'depth_before', 'depth_after', and 'width' properties. The function should only remove barriers and not perform any other optimizations. You must implement this using a function named `calculate_de...
calculate_depth_after_barrier_removal
from qiskit import QuantumCircuit qc = QuantumCircuit(3) qc.h(0) qc.barrier() qc.cx(0, 1) qc.barrier() qc.cx(1, 2) qc.measure_all() property_set = calculate_depth_after_barrier_removal(qc) assert "depth_before" in property_set assert "depth_after" in property_set
qiskitHumanEval/114
Create a CouplingMap with a specific coupling list, then modify it by adding an edge and a physical qubit. The initial coupling list is [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5]]. Add an edge (5, 6), and add a physical qubit "7". You must implement this using a function named `create_and_modify_coupling_map` with no argu...
create_and_modify_coupling_map
from qiskit.transpiler import CouplingMap cmap = create_and_modify_coupling_map() assert isinstance(cmap, CouplingMap) assert len(cmap.get_edges()) > 0 assert len(cmap.physical_qubits) >= 7
qiskitHumanEval/115
Create a Target object for a 2-qubit system and add UGate and CXGate instructions with specific properties. - Add UGate for both qubits (0 and 1) with parameters 'theta', 'phi', and 'lambda'. - Add CXGate for qubit pairs (0,1) and (1,0). - All instructions should have nonzero 'duration' and 'error' properties set. You ...
create_target
from qiskit.transpiler import Target target = create_target() assert isinstance(target, Target) assert len(target.instructions) > 0
qiskitHumanEval/81
Generate a QASM 2 string representing a Phi plus Bell state quantum circuit. Then, convert this QASM 2 string into a Quantum Circuit object and return the resulting circuit. You must implement this using a function named `convert_qasm_string_to_quantum_circuit` with no arguments.
convert_qasm_string_to_quantum_circuit
from qiskit import QuantumCircuit data = convert_qasm_string_to_quantum_circuit() assert isinstance(data, QuantumCircuit) assert data.num_qubits == 2
qiskitHumanEval/82
Create a file containing the binary serialization of a Phi plus Bell state quantum circuit and write it as 'bell.qpy' in binary mode. You must implement this using a function named `create_binary_serialization` with no arguments.
create_binary_serialization
import os from qiskit import qpy create_binary_serialization() assert os.path.exists("bell.qpy") with open("bell.qpy", "rb") as fd: data = qpy.load(fd)[0] assert data.num_qubits == 2
qiskitHumanEval/85
Given a QuantumCircuit, convert it into qasm2 string and return it. You must implement this using a function named `convert_quantum_circuit_to_qasm_string` with the following arguments: circuit.
convert_quantum_circuit_to_qasm_string
from qiskit import QuantumCircuit qc = QuantumCircuit(2, 2) qc.h(0) qc.cx(0, 1) qasm_str = convert_quantum_circuit_to_qasm_string(qc) assert isinstance(qasm_str, str) assert len(qasm_str) > 0 assert "OPENQASM" in qasm_str
qiskitHumanEval/125
Given a QuantumCircuit, convert it into a gate equivalent to the action of the input circuit and return it. You must implement this using a function named `circ_to_gate` with the following arguments: circ.
circ_to_gate
from qiskit import QuantumCircuit, QuantumRegister from qiskit.circuit.gate import Gate q = QuantumRegister(3, "q") circ = QuantumCircuit(q) circ.h(q[0]) circ.cx(q[0], q[1]) custom_gate = circ_to_gate(circ) assert isinstance(custom_gate, Gate) assert custom_gate.num_qubits == 3
qiskitHumanEval/12
Get unitary matrix for a phi plus bell circuit and return it. You must implement this using a function named `get_unitary` with no arguments.
get_unitary
import numpy as np result = get_unitary() assert hasattr(result, "shape") assert tuple(result.shape) == (4, 4)
qiskitHumanEval/41
Compose YX with a 3-qubit identity operator using the Operator and the Pauli 'YX' class in Qiskit. Return the operator instance. You must implement this using a function named `compose_op` with no arguments.
compose_op
from qiskit.quantum_info.operators import Operator result = compose_op() assert isinstance(result, Operator) assert result.num_qubits == 3
qiskitHumanEval/42
Combine the following three operators XX YY ZZ as: 0.5 * (XX + YY - 3 * ZZ). You must implement this using a function named `combine_op` with no arguments.
combine_op
from qiskit.quantum_info.operators import Operator result = combine_op() assert isinstance(result, Operator) assert result.num_qubits == 2
qiskitHumanEval/83
Construct a Phi plus Bell state quantum circuit, compute its Density Matrix and Concurrence, and return these results in a tuple in the same order. You must implement this using a function named `calculate_bell_state_properties` with no arguments.
calculate_bell_state_properties
from qiskit.quantum_info import DensityMatrix result = calculate_bell_state_properties() assert isinstance(result, tuple) assert len(result) == 2 rho, conc = result assert isinstance(rho, DensityMatrix) assert isinstance(conc, (int, float, complex))
qiskitHumanEval/92
Construct a Phi plus Bell state quantum circuit, compute its stabilizer state, and return both the stabilizer state and a dictionary of the stabilizer state measurement probabilities. You must implement this using a function named `calculate_stabilizer_state_info` with no arguments.
calculate_stabilizer_state_info
from qiskit.quantum_info import StabilizerState stab, probabilities_dict = calculate_stabilizer_state_info() assert isinstance(stab, StabilizerState) assert isinstance(probabilities_dict, dict) assert len(probabilities_dict) > 0
qiskitHumanEval/105
Initialize a CNOTDihedral element from a QuantumCircuit consist of 2-qubits with cx gate on qubit 0 and 1 and t gate on qubit 0 and return. You must implement this using a function named `initialize_cnot_dihedral` with no arguments.
initialize_cnot_dihedral
from qiskit.quantum_info import CNOTDihedral result = initialize_cnot_dihedral() assert isinstance(result, CNOTDihedral) assert result.num_qubits == 2
qiskitHumanEval/106
Create two Quantum Circuits of 2 qubits. First quantum circuit should have a cx gate on qubits 0 and 1 and a T gate on qubit 0. The second one is the same but with an additional X gate on qubit 1. Convert the two quantum circuits into CNOTDihedral elements and return the composed circuit. You must implement this using ...
compose_cnot_dihedral
from qiskit.quantum_info import CNOTDihedral result = compose_cnot_dihedral() assert isinstance(result, CNOTDihedral) assert result.num_qubits == 2
qiskitHumanEval/65
Design a Quantum Fourier Transform circuit for n qubits using basic Quantum gates. You must implement this using a function named `QFT` with the following arguments: n.
QFT
from qiskit import QuantumCircuit result = QFT(3) assert isinstance(result, QuantumCircuit) assert result.num_qubits == 3 for gate in result.data: op = gate.operation assert op.num_qubits <= 2 or op.name == "barrier"
qiskitHumanEval/78
Return an inverse quantum Fourier transform circuit without the swap gates. You must implement this using a function named `qft_no_swaps` with the following arguments: num_qubits.
qft_no_swaps
from qiskit import QuantumCircuit for num_qubits in [1, 3, 8]: response = qft_no_swaps(num_qubits) assert isinstance(response, QuantumCircuit) assert response.num_qubits == num_qubits assert response.count_ops().get("swap", 0) == 0
qiskitHumanEval/84
Create a 2-qubit quantum circuit where you define a custom 1-qubit unitary gate (e.g., U3) and apply it as a controlled gate with qubit 0 as control and qubit 1 as target. Return the final circuit. You must implement this using a function named `controlled_custom_unitary_circuit` with no arguments.
controlled_custom_unitary_circuit
from qiskit import QuantumCircuit qc = controlled_custom_unitary_circuit() assert isinstance(qc, QuantumCircuit) assert qc.num_qubits == 2 assert len(qc.data) > 0
qiskitHumanEval/89
Construct a quantum circuit with a three-qubit controlled-Hadamard gate, using qubit 0 and qubit 1 as the control bits and qubit 2 as the target bit. Return the circuit. You must implement this using a function named `create_controlled_hgate` with no arguments.
create_controlled_hgate
from qiskit import QuantumCircuit qc = create_controlled_hgate() assert isinstance(qc, QuantumCircuit) assert qc.num_qubits == 3 assert len(qc.data) > 0
qiskitHumanEval/90
Create a custom 2-qubit gate with an X gate on qubit 0 and an H gate on qubit 1. Then, add two control qubits to this gate. Apply this controlled gate to a 4-qubit circuit, using qubits 0 and 3 as controls and qubits 1 and 2 as targets. Return the final circuit. You must implement this using a function named `create_cu...
create_custom_controlled
from qiskit import QuantumCircuit candidate_circuit = create_custom_controlled() assert isinstance(candidate_circuit, QuantumCircuit) assert candidate_circuit.num_qubits == 4 assert len(candidate_circuit.data) > 0
qiskitHumanEval/112
Create a quantum circuit using LieTrotter for a list of Pauli strings and times. Each Pauli string is associated with a corresponding time in the 'times' list. The function should return the resulting QuantumCircuit. You must implement this using a function named `create_product_formula_circuit` with the following argu...
create_product_formula_circuit
from qiskit import QuantumCircuit pauli_strings = ["X", "Y", "Z"] times = [1.0, 2.0, 3.0] reps = 1 candidate_circuit = create_product_formula_circuit(pauli_strings, times, reps) assert isinstance(candidate_circuit, QuantumCircuit) assert candidate_circuit.num_qubits == 1 assert len(candidate_circuit.data) > 0
qiskitHumanEval/116
Synthesize an evolution gate using MatrixExponential for a given Pauli string and time. The Pauli string can be any combination of 'I', 'X', 'Y', and 'Z'. Return the resulting QuantumCircuit. You must implement this using a function named `synthesize_evolution_gate` with the following arguments: pauli_string, time.
synthesize_evolution_gate
from qiskit import QuantumCircuit qc = synthesize_evolution_gate("X", 1.0) assert isinstance(qc, QuantumCircuit) assert qc.num_qubits == 1 assert len(qc.data) > 0

Quantum API Drift

Quantum API Drift is an evaluation benchmark for measuring whether LLM-generated quantum code targets the requested Qiskit SDK version. It accompanies the paper Benchmarking API Drift in LLM-Generated Quantum Code Across Successive SDK Versions.

The benchmark evaluates version fidelity, cross-version compatibility, failure modes, and documentation-guided repair across Qiskit 0.43, 1.3, and 2.0.

Dataset Configurations

benchmark

The default configuration contains 50 evaluation tasks. Each row has:

  • id: the upstream Qiskit HumanEval task identifier
  • description: the natural-language coding task
  • entry_point: the function the generated code must define
  • test_call: executable assertions used by the benchmark harness

Load it with:

from datasets import load_dataset

dataset = load_dataset("arasyi/quantum-api-drift")
tasks = dataset["test"]

version_anchored

This configuration contains 150 prompts: one prompt for each combination of 50 tasks and three requested SDK versions. Each row has:

  • id: the source task identifier
  • version: v0, v1, or v2
  • entry_point: the required function name
  • test_call: executable assertions
  • prompt: the complete SDK-version-anchored generation prompt

The version labels map to Qiskit releases as follows:

Label Qiskit version
v0 0.43
v1 1.3
v2 2.0

Load it with:

from datasets import load_dataset

dataset = load_dataset(
    "arasyi/quantum-api-drift",
    "version_anchored",
)
prompts = dataset["test"]

Auxiliary Files

The migration_notes/ directory contains the migration guidance used by the documentation-guided repair experiments:

  • v0_to_v1.txt: Qiskit 0.43 to 1.3
  • v1_to_v2.txt: Qiskit 1.3 to 2.0

These files are research artifacts and are not loaded as dataset rows.

Source and Modifications

The task descriptions and identifiers are derived from the Qiskit HumanEval dataset and its source repository, which are distributed under the Apache License 2.0.

Quantum API Drift modifies the upstream material by selecting 50 tasks, adapting executable test calls for cross-version evaluation, and constructing SDK-version-specific prompts. The modification and attribution notice is also provided in NOTICE.

Intended Use

This dataset is intended for evaluating version-aware quantum code generation, cross-version execution compatibility, API-drift failure modes, and documentation-guided repair. All rows are evaluation data and are published in the test split; they should not be presented as a training split.

Limitations

  • The benchmark measures API-level and execution-level validity, not full semantic circuit correctness.
  • Results depend on the execution environment and pinned Qiskit versions.
  • Repair results depend on the supplied migration notes.
  • The source benchmark and this derivative are public, so evaluations should discuss possible benchmark contamination.
  • Model generations, execution traces, and aggregate paper results are not included in this dataset repository.

License

The dataset is distributed under the Apache License 2.0. See LICENSE and NOTICE for the complete terms and attribution.

Citation

@misc{rasyidi2026benchmarkingapidrift,
  title={Benchmarking API Drift in LLM-Generated Quantum Code Across Successive SDK Versions},
  author={Rasyidi, Mohammad Arif and Faiz, Syahirul},
  year={2026},
  eprint={2607.04072},
  archivePrefix={arXiv},
  primaryClass={cs.SE},
  doi={10.48550/arXiv.2607.04072},
  url={https://arxiv.org/abs/2607.04072}
}

When reusing the underlying tasks, also cite the Qiskit HumanEval project.

Downloads last month
10

Paper for arasyi/quantum-api-drift