Inference compilation functions

Misc


source

split_U_to_tensor

 split_U_to_tensor (U:numpy.ndarray)

source

get_new_unitary_indices

 get_new_unitary_indices (Us, dataset, silent=False)

source

get_new_unitary_indices_batch

 get_new_unitary_indices_batch (Us, dataset, auto_batch_size=32,
                                silent=False, n_jobs=1)

Generation


source

generate_comp_tensors

 generate_comp_tensors (pipeline, prompt, U, samples, system_size,
                        num_of_qubits, max_gates, g, no_bar=True,
                        unique=False, auto_batch_size=512)

Accuracy


source

check_correct_gates

 check_correct_gates (qc, num_of_qubits, gate_pool, max_gates,
                      allowed_gate_clrs)

source

check_correct_unitary_exact

 check_correct_unitary_exact (qc, U)

source

check_correct_unitary_distance

 check_correct_unitary_distance (qc, target_U, norms)

source

get_gate_and_U_acc

 get_gate_and_U_acc (out_tensor, allowed_gate_clrs, U, gate_pool,
                     num_of_qubits, max_gates, norms=[], no_bar=True)

Tests


source

test_comp_acc

 test_comp_acc (pipeline, samples, system_size, gate_pool, num_of_qubits,
                max_gates, g, str_cond_to_gate_indices:<built-
                infunctioncallable>, Us, ys, train_dataset=None, norms=[])

source

test_comp_acc_on_testset

 test_comp_acc_on_testset (pipeline, samples, num_of_U, system_size,
                           gate_pool, num_of_qubits, max_gates, g,
                           str_cond_to_gate_indices:<built-
                           infunctioncallable>, prompt_mod:<built-
                           infunctioncallable>, test_dataset,
                           train_dataset=None, norms=[], fix_y=None)

returns: acc_s, gate_acc_s, u_acc_s, uniques_cnt_s, error_cnt_s, num_found_circuits_s, task_qc_len_s


source

test_comp_acc_on_rnd_samples

 test_comp_acc_on_rnd_samples (pipeline, samples, num_of_U, system_size,
                               gate_pool, num_of_qubits, max_gates, g,
                               str_cond_to_gate_indices:<built-
                               infunctioncallable>, prompt_mod:<built-
                               infunctioncallable>, rnd_min_gates,
                               rnd_max_gates, train_dataset=None,
                               norms=[], fix_y=None)

returns: acc_s, gate_acc_s, u_acc_s, uniques_cnt_s, error_cnt_s, num_found_circuits_s, task_qc_len_s

Type Default Details
pipeline
samples
num_of_U
system_size
gate_pool
num_of_qubits
max_gates
g
str_cond_to_gate_indices callable
prompt_mod callable takes a single prompt and returns it modified
rnd_min_gates
rnd_max_gates
train_dataset NoneType None
norms list []
fix_y NoneType None

Plot


source

plot_hist_overview

 plot_hist_overview (out_tuple, num_of_samples_per_U, rnd_min_gates,
                     rnd_max_gates, max_gates, num_of_qubits)
Back to top