<jupyter_start><jupyter_text>Gaussian Boson Sampling Gaussian Boson Sampling can be performed as shown by the following example:<jupyter_code>import numpy as np
import piquasso as pq


d = 5
shots = 5

A = np.array(
    [
        [0, 1, 0, 1, 1],
        [1, 0, 0, 0, 1],
        [0, 0, 0, 1, 0],
        [1, 0, 1, 0, 1],
        [1, 1, 0, 1, 0],
    ]
)

with pq.Program() as gaussian_boson_sampling:
    pq.Q(all) | pq.Graph(A)

    pq.Q(all) | pq.ParticleNumberMeasurement()


simulator = pq.GaussianSimulator(d=d)

result = simulator.execute(gaussian_boson_sampling, shots=shots)

print("Samples:", result.samples)<jupyter_output>Samples: [(3, 1, 2, 4, 4), (0, 1, 0, 0, 1), (0, 0, 0, 0, 0), (2, 2, 0, 4, 4), (0, 0, 0, 1, 1)]<jupyter_text>The generated samples could be used to acquire some denser subgraphs of the generated graph with<jupyter_code>print("Subgraphs:", result.to_subgraph_nodes())<jupyter_output>Subgraphs: [[0, 0, 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4], [1, 4], [], [0, 0, 1, 1, 3, 3, 3, 3, 4, 4, 4, 4], [3, 4]]
{'fraction_non_alphanumeric': 0.17801556420233464, 'fraction_numerical': 0.07976653696498054, 'mean_word_length': 3.5733333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '148892', 'license': 'Apache-2.0', 'n_tokens_mistral': 518, 'n_tokens_neox': 430, 'n_words': 139, 'path': 'docs/tutorials/gaussian-boson-sampling.ipynb', 'repo_name': 'antalszava/piquasso', 'size': '1028'}