<jupyter_start><jupyter_text>Covert QUBO to Pauli operator on Universal Gate ModelWilqat has function to automatically convert QUBO to Pauli operators for quantum simulation on QAOA Wildqat and BlueqatWe need blueqat to calculate universal gate model simualtion<jupyter_code>!pip install wildqat
!pip install blueqat<jupyter_output><empty_output><jupyter_text>ExampleWith wildqat first we create a QUBO matrix which select K qubits from Nqubits, and then try to convert it to pauli operator. We now try select 1 qubit from 4 qubits<jupyter_code>import wildqat as wq
from blueqat import vqe

qubo = wq.pauli(wq.sel(4,1))
step = 4
result = vqe.Vqe(vqe.QaoaAnsatz(qubo,step)).run()
print(result.most_common(5))<jupyter_output>(((1, 0, 0, 0), 0.2226406659245161), ((0, 1, 0, 0), 0.222640665924516), ((0, 0, 1, 0), 0.222640665924516), ((0, 0, 0, 1), 0.22264066592451595), ((0, 0, 0, 0), 0.02866208270294894))<jupyter_text>All finished. with wq.sel() we choose 1 of 4 qubits.And wq.pauli() convert QUBO to pauli operator."step" affects to the accuracy of the simulation on QAOAFinally we get the 5 sampling result from QAOA+VQE simulation on Blueqat universal gate model simulator.Universal model has wave function and state vector, and with the simulator we can easily see the probability as value.<jupyter_code>qubo = wq.pauli(wq.sel(10,3))
step = 4
result = vqe.Vqe(vqe.QaoaAnsatz(qubo,step)).run()
print(result.most_common(5))<jupyter_output>(((0, 1, 1, 0, 0, 0, 1, 0, 0, 0), 0.006107876447827839), ((0, 0, 0, 0, 0, 1, 1, 1, 0, 0), 0.006107876447827838), ((0, 1, 0, 1, 0, 0, 1, 0, 0, 0), 0.006107876447827837), ((0, 0, 0, 0, 0, 1, 1, 0, 1, 0), 0.006107876447827837), ((0, 0, 0, 0, 0, 1, 0, 1, 1, 0), 0.006107876447827837))
{'fraction_non_alphanumeric': 0.1296511627906977, 'fraction_numerical': 0.15348837209302327, 'mean_word_length': 5.5437262357414445, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '381254', 'license': 'Apache-2.0', 'n_tokens_mistral': 873, 'n_tokens_neox': 666, 'n_words': 226, 'path': 'examples_en/tutorial025_QUBO_to_Pauli_en.ipynb', 'repo_name': 'mori388/annealing', 'size': '1720'}