<jupyter_start><jupyter_text>QBOB |👷🏾‍♂️> controlled operations  Controlled X<jupyter_code>from qbob import qbob
from qbob.intrinsics import X, Z, M, H
my_qbob = qbob.OperationBuilder("TestControlled")
with my_qbob.allocate_qubits("q", 2) as q:
    my_qbob += H(q[1])
    my_qbob += X(q[0]).controlled_on(q[1])
    my_qbob.returns([M(q[0]), M(q[1])])
print(my_qbob.build())
controlled_x = my_qbob.compile()
[controlled_x() for _ in range(10)]<jupyter_output><empty_output><jupyter_text>Apply controlled on bitstring<jupyter_code>my_qbob = qbob.OperationBuilder("TestOnBitstring")
with my_qbob.allocate_qubits("q", 4) as q:
    my_qbob += H(q[1])
    my_qbob += X(q[0]).controlled_on_bit_string([False, False, False], [q[1], q[2], q[3]])
    my_qbob.returns([M(q[0]), M(q[1]), M(q[2]), M(q[3])])
print(my_qbob.build())
controlled_on_bit_string = my_qbob.compile()
[controlled_on_bit_string() for _ in range(10)]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18085106382978725, 'fraction_numerical': 0.02127659574468085, 'mean_word_length': 7.327433628318584, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '382675', 'license': 'MIT', 'n_tokens_mistral': 431, 'n_tokens_neox': 405, 'n_words': 65, 'path': 'examples/qbob_controlled.ipynb', 'repo_name': 'quantum-experiments/qbob', 'size': '940'}