Coverage for tests/pipelines/data_generation/test_data_generation.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-27 09:52 +0000

1from quafel.pipelines.data_generation.nodes import ( 

2 generate_random_qasm_circuit, 

3 generate_evaluation_matrix, 

4 qasm_circuit_to_qiskit, 

5 calculate_measures, 

6) 

7 

8 

9def test_circuit_generation(): 

10 generate_random_qasm_circuit(5, 5, 0) 

11 

12 

13def test_evaluation_matrix(): 

14 generate_evaluation_matrix( 

15 5, 5, 5, "linear", 5, 5, 5, "linear", 5, 5, 5, "linear", ["qiskit"] 

16 ) 

17 

18 

19def test_circuit_conversion(): 

20 qasm_circuit = generate_random_qasm_circuit(5, 5, 0)["qasm_circuit"] 

21 qasm_circuit_to_qiskit(qasm_circuit)["qiskit_circuit"] 

22 

23 

24def test_calculate_measures(): 

25 qiskit_circuit = generate_random_qasm_circuit(5, 5, 0)["qiskit_circuit"] 

26 calculate_measures( 

27 circuit=qiskit_circuit, 

28 samples_per_parameter=5, 

29 haar_samples_per_qubit=5, 

30 seed=1000, 

31 )