Camille Houdelet
email: camillehoudelet@hotmail.fr

Eva Blondeau-Bidet
email: eva.blondeau-bidet@cnrs.fr

Mathilde Estevez-Villar
email: mathilde.estevez-villar@mgx.cnrs.fr

Xavier Mialhe
email: xavier.mialhe@mgx.cnrs.fr

Sophie Hermet
email: sophie.hermet@umontpellier.fr

Francois Ruelle
email: francois.ruelle@ifremer.fr

Gilbert Dutto
email: gilbert.dutto@ifremer.fr

Aline Bajek
email: aline.bajek@ecloserie-emg.com

Julien Bobe
email: julien.bobe@inra.fr

Benjamin Geffroy
email: benjamin.geffroy@ifremer.fr

François Ruelle

Eva Blondeau

François Ruelle

Circulating MicroRNAs Indicative of Sex and Stress in the European Seabass (Dicentrarchus labrax): Toward the Identification of New Biomarkers

Keywords: sex differentiation, cortisol, glucocorticoid receptor, fish, blood plasma, miRNAs

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Introduction

Identifying new, poorly-invasive, technics to depict clear phenotypes is of major interest in fishery and aquaculture contexts [START_REF] Brosset | Physiological biomarkers and fisheries management[END_REF][START_REF] Raposo De Magalhães | A Proteomics and other Omics approach in the context of farmed fish welfare and biomarker discovery[END_REF]. For instance, consumers are now highly concerned by the welfare of harvested fish, and accurately monitoring stress is thus becoming crucial for both industries. Managing sex-ratio of farmed population is also primordial for producers, since in many fish species i) there is a strong sexual size dimorphism, and a clear benefit in producing the fastestgrowing sex and ii) having a sufficient number of males and females is essential to guarantee successful genetic programs. Sexing wild fish with poorly-invasive tools can also be valuable to fully understand population dynamics in marine animals (e.g., Tunas) in which it is impossible to distinguish males from females based on external phenotypic characteristics.

The European seabass (Dicentrarchus labrax) is a convenient model to scrutinize all the above-mentioned issues, as it brings together all questioning. First, it is a recognized model of interest in aquaculture and fisheries [START_REF] Vandeputte | The European sea bass: A key marine fish model in the wild and in aquaculture[END_REF]. Second, reliable basal levels of cortisol (major indicator of stress) are highly difficult to obtain in this species [START_REF] Sadoul | Global assessment of the response to chronic stress in European sea bass[END_REF][START_REF] Vandeputte | Quantitative genetic variation for post-stress cortisol and swimming performance in growth-selected and control populations of European sea bass (Dicentrarchus labrax)[END_REF] and is considered very high in relation to other species [START_REF] Samaras | Stress and metabolic indicators in a relatively high (European sea bass, Dicentrarchus labrax) and a low (meagre, Argyrosomus regius) cortisol responsive species, in different water temperatures[END_REF]. Third, there is currently no practical tools to distinguish males from females in this species that possess a polygenic sex determination system, with effects of the environment [START_REF] Geffroy | Unraveling the genotype by environment interaction in a thermosensitive fish with a polygenic sex determination system[END_REF][START_REF] Vandeputte | A polygenic hypothesis for sex determination in the European sea bass Dicentrarchus labrax[END_REF]. Indeed, it is only possible to visually and accurately discriminate males from females based on their size when they reach a certain age (i.e., after 3 years; [START_REF] Chatain | La génétique du bar (Dicentrarchus labrax L.)[END_REF]. Hence, having other, poorly-invasive tools, to monitor sex and stress would be a real asset for this species, but also for many other exhibiting similar characteristics. Circulating microRNAs (miRNAs) could well fulfill these roles.

MiRNAs are short and conserved non-coding sequences of nucleotides (20-22 nt) involved in the regulation of multiple biological processes by post-transcriptional repression of target mRNA [START_REF] Bartel | Metazoan MicroRNAs[END_REF].

MicroRNAs act as gene regulators through a base-pairing interaction with mRNAs, and a sequence similarity of 6 to 8 nucleotides (seed sequence) is sufficient to deregulate a mRNA. Thus, a given miRNA could, in theory, interact with multiple mRNAs (up to several hundreds), and one mRNA could be the target of multiple miRNA [START_REF] Fabian | Regulation of mRNA Translation and Stability by microRNAs[END_REF]. MiRNAs present very advantageous characteristics to track physiological states, so that they are considered as efficient biomarkers. First, miRNAs are highly conserved in evolution, which support the prominent hypothesis of a fundamental role in the biology of metazoan was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint 4 [START_REF] Bartel | MicroRNAs: Target Recognition and Regulatory Functions[END_REF][START_REF] Desvignes | miRNA analysis with Prost! Reveals evolutionary conservation of organ-enriched expression and post-transcriptional modifications in three-spined stickleback and zebrafish[END_REF][START_REF] Wheeler | The deep evolution of metazoan microRNAs[END_REF]. Second, they can be quantified in different tissues, but also in the extracellular part of various body fluids (e.g., serum, blood plasma, urine, saliva; [START_REF] Mohr | Overview of MicroRNA Biology[END_REF]. Since their discovery, they have been widely used for health-associated diagnostics in humans, mainly for tumor detection [START_REF] Duttagupta | Impact of Cellular miRNAs on Circulating miRNA Biomarker Signatures[END_REF][START_REF] Lu | MicroRNA expression profiles classify human cancers[END_REF], but there is an increasing interest in using them as biomarkers in other species. MiRNAs were shown to display distinct levels of expression between the gonads of males and females in various fish species [START_REF] Bhat | Role of sex-biased miRNAs in teleosts -a review[END_REF][START_REF] Gu | Differential expression analysis of Paralichthys olivaceus microRNAs in adult ovary and testis by deep sequencing[END_REF][START_REF] Jing | Sex-biased miRNAs in gonad and their potential roles for testis development in yellow catfish[END_REF][START_REF] Tao | Integrated analysis of miRNA and mRNA expression profiles in tilapia gonads at an early stage of sex differentiation[END_REF]. However, to the best of our knowledge, sex-specific miRNAs have not yet been described in fluids (like the plasma). A recent study conducted in rainbow trout (Onchorynchus mykiss) identified a repertoire of circulating miRNAs that reflect the physiological and reproductive state of the species [START_REF] Cardona | Circulating miRNA repertoire as a biomarker of metabolic and reproductive states in rainbow trout[END_REF]. Regarding stress, miRNAs were also shown to transduce different stressful environments [START_REF] Raza | MicroRNAs mediated environmental stress responses and toxicity signs in teleost fish species[END_REF], where the impact of xenobiotics [START_REF] Burgos-Aceves | MicroRNAs and their role on fish oxidative stress during xenobiotic environmental exposures[END_REF], handling [START_REF] Cadonic | Acute air exposure modulates the microRNA abundance in stress responsive tissues and circulating extracellular vesicles in rainbow trout (Oncorhynchus mykiss)[END_REF][START_REF] Ikert | High Throughput Sequencing of MicroRNA in Rainbow Trout Plasma, Mucus, and Surrounding Water Following Acute Stress[END_REF] or thermal stress [START_REF] Raza | MicroRNAs mediated environmental stress responses and toxicity signs in teleost fish species[END_REF] have been pinpointed. Still, we

do not yet know how circulating miRNAs correlate to stress-induced cortisol levels.

The main objectives of this study were to characterize the circulating miRNAs associated with sex and stress in the European seabass and to evaluate to what extent they can be easily quantified in the plasma by qPCR, with the ultimate goal of using them as biomarkers.

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

Material and methods

Experiments were performed in accordance with relevant guidelines and regulations provided by the ethic committee (no 36) of the French Ministry of Higher Education, Research and Innovation and the experiment received the following agreement number: APAFIS #30612-2021031812193539.

2.1.

Sample collection

Experiment 1: Sex identification

A total of forty immature (mean weight: 44 ± 11 g and length: 15 ± 1 cm) and twenty mature (1387 ± 303 g and 46 ± 4 cm) fish were randomly collected from the experimental aquaculture station of Ifremer (Palavasles-Flots, France) and Aquanord aquaculture site (Gravelines, France) respectively. A blood sample (1 ml, see details below) was collected from each individual, as well as a piece of gonad for immature fish to histologically sex them (Fig. 1A). For qPCR analyses, supplementary individuals were collected and sexed (validation non-sequenced 1, Table 1) as well as fish from the stress experiment (validation non-sequenced 2, Table 1).

Table 1 Summary of the number of samples used for small RNA-seq and qPCR analyses

Experiment 2: Stress experiment

Juvenile European Seabass (n = 63, mean weight: 42.1 ± 15.7 g and length: 14.5 ± 1.5 cm) were maintained in a recirculating aquaculture system, with three tanks of 1.5 m 3 each (21.0 ± 0.1 °C and water renewing at 1.2 m 3 /h), connected to a common biofilter tank. The three tanks were covered with a black tarpaulin ensuring they were visually isolated from the experimenters. The photoperiod (12L/12D) inside the tarpaulin was maintained using a specific a light system: AquaRay miniLED 500, 10000K white (Tropical Marine Center). Fish were fasted 24 h prior the start of the experiment. Beforehand the stress procedure, six fish per

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint tank (n=18 in total) were quickly sampled and euthanized using benzocaine (150 mg/L). The blood was immediately collected by 3 experimenters, ensuring that all fish were collected within 2 minutes to avoid cortisol rise commonly reported after death (Sadoul and Geffroy, 2019). Thenceforward, 15 fish per tank were quickly placed in a 10L bucket at a density of 300kg/m3 for 2 minutes. Following this confinement challenge, they were placed in 3 recovering tanks (100L tanks, supplied with renewed water from the same original tank) to recover from the stress for 0.5, 1.5 and 6 hours (Fig. 1B). Supplementary individuals were collected for qPCR validation (n = 30) see details in Table 2).

Table 2 Summary of the number of samples used for small RNA-seq and qPCR validation of stress biomarkers Blood sampling At 0.5, 1.5 and 6 hours following the confinement challenge, a subsample of five fish was collected from each tank (total n=15 per recovering tank), euthanized with a lethal dose benzocaine (150mg/L) and sexed (note that one individual was not sexed). The blood was sampled from the caudal vein thanks to EDTAcoated syringes. After centrifugation (3000 x g, 5 min, 10°C) the plasma was allocated in two new tubes: one part for cortisol quantification (20µL) and the other part for small-RNA sequencing, stocked at -20°C and -80°C, respectively.

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. Identification of markers

Histology

Gonads of immature European seabass were fixed in Bouin's fluid for 6 to 8 h and rinsed in clear water for one hour. Then, they were rinsed in EtOH 70% for several days and placed in a dehydration automate (STP 120, MM, France). Each gonad was embedded in paraffin and cut at 5µm sections. Slides were stained using the Masson's trichrome methods (MYREVA SS30, MM, France).

Measurement of stress

Plasmatic cortisol was measured using a Cortisol ELISA kit (Neogen Lexington, KY, USA). According to the supplier, the cross-reactivity of the antibody with other steroids is as follows: prednisolone 47. read at 650 nm with a microplate reader (Synergy HT, BioTek Instrument, VT, USA) after 30 minutes of incubation in the dark. To confirm the repeatability of the experiment, one sample was placed on the three different plates. Parallel displacement curves were obtained for plasma by comparing serial dilutions of pooled plasma (1:1 -1:250) and the cortisol standard preparation (0.04 -10 ng/ml). All values are expressed with the standard error.

RNA extractions

Thawed plasma of each fish from the two experiments was homogenized in QIAzol lysis reagent (Beverly, MA, USA) following manufacturer's instructions. The total RNA was resuspended in 15 µL of RNAse free water. MiRNAs were quantified using the smallRNA Analysis kit (DNF-470-0275) on a Fragment Analyzer (Agilent).

Small RNA Sequencing

Following these steps, six matures (over the 20 collected) and ten immatures (over the 40 collected) individuals from first experiment (sex identification) and 21 individuals from the second experiment (stress experiment) were of sufficient quality and quantity, to be further processed (Table 1 andTable 2). Libraries were constructed using the NEXTFLEX Small RNA-seq kit v3 (Perkin Elmer, #NOVA-5132-05). Briefly, a 3' Adenylated adapter was ligated to the 3' end of 0,5 ng of microRNA and purified to remove 3' adapter excess. A 5' adapter was ligated to the 5' end of the 3' ligated microRNA. The resulting construction was purified to remove 5' adapter excess. 5' and 3' ligated microRNAs underwent a reverse transcription using a M-MuLV reverse Transcriptase and a RT primer complementary to the 3' adapter. Resulting cDNAs were used as a matrix in a 25 cycles PCR using a pair of uniquely barcoded primers. The resulting barcoded library was size selected on a Pippin HT (SAGE Science) using 3 % agarose cassette (#HTG3004) and aiming for a size range between 147 bp and 193 bp. Once size selected, libraries were verified on a Fragment Analyzer using the High Sensitivity NGS kit (#DNF-474-0500) and quantified using the KAPA Library quantification kit (Roche, ref. KK4824).

MiRNA alignment and quantification

Image analyses and base calling were performed using the NovaSeq Control Software and Real-Time Analysis component (Illumina). Demultiplexing was performed using Illumina's conversion software was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint (bcl2fastq 2.20). The quality of the raw data was assessed using FastQC from the Babraham Institute and the Illumina software SAV (Sequencing Analysis Viewer).

The raw reads were trimmed using Cutadapt (version 3.5) [START_REF] Martin | Cutadapt removes adapter sequences from high-throughput sequencing reads[END_REF] to remove the sequencing adapter (TGGAATTCTCGGGTGCCAAGG) at the 3′-end. Additionally, 4 bases were also trimmed from the 5′-end and 3′-end of the reads as indicated in the manual of NEXTflex Small RNA-Seq Kit v3 from Bio Scientific.

Before counting step, samples with a rRNA degradation profile were filtered out. This resulted in 13 and 16 immature and mature fish, respectively, for the experiment on sex and 21 fish for the experiment on stress.

MiRNA analysis was performed with Prost ! v0.7.60 pipeline [START_REF] Desvignes | miRNA analysis with Prost! Reveals evolutionary conservation of organ-enriched expression and post-transcriptional modifications in three-spined stickleback and zebrafish[END_REF]. In this pipeline, alignment was performed with BBMap [START_REF] Bushnell | BBMap: A Fast, Accurate, Splice-Aware Aligner (LBNL-7065E)[END_REF] version 38.90 to genome of interest : Dicentrarchus labrax GCA_000689215.1_seabass_V1.0. The miRNA annotation and counting were retrieved by Prost! (parameters in Text S1) from a custom annotation provided in miRBase v21 (available in Prost! Github) using Gasterosteus aculeatus miRNA sequences (the phylogenetically closest species).

2.3.

Validation of markers by qPCR

cDNA synthesis and quantitative real-time PCR

For the validation of markers by qPCR, total RNA from each of the non-sequenced samples (n = 56 individuals for sex and n = 30 individuals for stress; Table 1) were normalized at 10 ng/µL and the reverse transcription of RNA was done following the manufacturer instructions (miRCURY LNA RT Kit, Qiagen).

We added 0.5µl of controls UniSp6 and cel-mir-39-3p to the samples as internal reference to check the efficiency of the reverse transcription and PCR amplification, respectively. The reverse transcription reaction was conducted on a total volume of 10 µL containing 5 µL of 2x miRCURY SYBR Green Master Mix, 1 µL of the resuspended primer mix (miRCURY LNA PCR Assay), 3µL of diluted cDNA and 1µL of RNase-free water. Quantitative RT-PCR was performed on a Light Cycler 480 System (Roche Life Science) with the following conditions: 95°C for 2 min, and 45 cycles of 95°C for 10sec, 56°C for 60sec.

In addition to the exogenous control (cel-miR-39-3p), we selected one endogenous miRNA based on the small RNA sequencing and that was stable regarding the different conditions: miR-23b-2-3p. Sequences of miRNAs primer are provided in Table S1.

Statistical analysis

Differentially expressed miRNA were identified using one Bioconductor [START_REF] Gentleman | Bioconductor: Open software development for computational biology and bioinformatics[END_REF] package:

DESeq2 1.32.0 [START_REF] Love | Moderated estimation of fold change and dispersion for RNAseq data with DESeq2[END_REF]. Data were normalized using the default method for DESeq2 package.

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint 10 MiRNA with adjusted p-value below 5% (according to the FDR method from Benjamini-Hochberg) were considered significantly differentially expressed between conditions: Sex (Male vs Female) or Stress (0 vs 0.5 vs 1.5 vs 6 hours).

For qPCR experiments, the differences between sex or timing after stress was assessed using the nonparametric Kruskal-Wallis test [START_REF] Kruskal | Use of ranks in one-criterion variance analysis[END_REF]. For RT-qPCR on non-sequenced samples for sexing (n = 46; Table 1), a linear mixed-effects model was applied to consider the experiment effect. To identify the miRNAs that presented a linear increase (or decrease) in expression over time, following the confinement challenge, we ran a loop in R to automatically detect all miRNAs (normalized counts) that are significantly correlated to the time. For cortisol level analyses, the differences between timing after stress was assessed using the non-parametric Kruskal-Wallis test. A Non-metric Multi-dimensional Scaling (NMDS) approach was used to compare individuals from the different time-points and that presented various cortisol levels. The package vegan v2.6-2 [START_REF] Oksanen | Package 'vegan[END_REF] was used and the construction of the dissimilarity matrix was based on the Bray-Curtis methods. All statistical analyses presented in this section were conducted with the R v 4.1.0 (Core Team, 2020).

Prediction of target

We first retrieved the 3'UTR sequences from the European seabass genome browser (http://seabass.mpipz.mpg.de/) that is based on the published genome of the European seabass [START_REF] Tine | European sea bass genome and its variation provide insights into adaptation to euryhalinity and speciation[END_REF]. To identify miRNA targets, we used the freely available Perl script of TargetScanHuman 8.0.

(https://www.targetscan.org/vert_80/) [START_REF] Agarwal | Predicting effective microRNA target sites in mammalian mRNAs[END_REF]. In order to be the more specific possible, we used a conservative approach, consisting of focusing only on genes presenting a 8-mer sequence in the 3'UTR region; hence with an exact match to positions 2-8 of the mature miRNA (the seed + position 8)

followed by an 'A'. The "enrichGO" function of the R package ClusterProfiler version 4.4.4 [START_REF] Yu | clusterProfiler: An R Package for Comparing Biological Themes Among Gene Clusters[END_REF], with the GO dataset of the European sea bass was used to analyse function profiles of all genes potentially targeted by a given miRNA. A hypergeometric test was performed and enrichment p-value of gene ontology was calculated to find significantly enriched GO terms in the input list of each mirRNA target genes.

Enrichment analysis was performed and a P value <0.05 was considered to indicate a statistically significant difference. The "ggplot 2" and "enrichplot" R packages were used to generate the cnetplot. The proportion of clusters in the pie chart was determined by the number of genes.

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint 11 3. Results

Identification of miRNA differentially expressed between sex

Gonads of juveniles' fish that were used for identification of sex markers were histologically differentiated, allowing to clearly discriminating males from females. Oocytes from ovarian tissues were at the primary growth stage (Fig. S1A), while some spermatocytes, spermatids and spermatozoids were distinguishable in the testis (Fig. S1B).

A total of 223 miRNAs, from the 10 samples sequenced (immature individuals), were annotated with Prost! [START_REF] Desvignes | miRNA analysis with Prost! Reveals evolutionary conservation of organ-enriched expression and post-transcriptional modifications in three-spined stickleback and zebrafish[END_REF]. Among these miRNAs, 11 were differentially expressed between immature males and females (Table S2). Eight of these miRNAs were significantly more abundant in females, while the remaining three miRNAs were significantly more abundant in males. From that list of 11 miRNAs, we identified three miRNAs potentially acting on the regulation of genes involved in pathways of sexual development (based on the mammalian literature). Specifically, both miR-1388-3p and miR-7132a-5p

were up-regulated in the females' plasma (padj = 0.004 and p = 0.0003; Fig. 2A), while miR-499a-5p was more abundant in males' plasma (padj = 0.0006, Fig. 2A). They were thus chosen for further validations by qPCR (Table 1). Both, miR-7132a-5p and miR-499a-5p were validated (Fig. 2B) on the sample sent to sequencing. To test for their consistency, additional immature individuals were analyzed (n = 10 on nonsequenced 1, n = 9 on non-sequenced 2; n = 27 sampled in the stress experiment, Table 1). No significant differences were observed between males and females, even though the miR-499a-5p tended to be higher in males than females for the three set of samples (Fig. S2). We also took advantage of the sequencing of individuals from the stress experiment to perform a DESeq2 analysis on the sex (all stressful conditions mixed; 9 M vs 11 F, Table 1). Only the miR-499-a-5p tended to be more abundant in plasma of males (adjusted p-value = 0.38, non-adjusted p-value = 0.01; Table S3).

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. A total of 441, 692 and 288 genes were predicted as potential target for respectively miR-1388-3p, miR-499a-5p and miR-7132a-5p (Table S4). For each miRNA, potential target genes were classified by their molecular function (MF) and biological processes (BP). On a total of 16368 possible biological processes in the European seabass, we detected only 59 significantly enriched GO for miR-7132a-5p, 103 significantly enriched GO for miR-499a-5p and 97 significantly enriched GO for miR-1388-3p (Table S5). On a total of 20503 possible molecular functions in the European seabass, we detected only 17 significantly enriched GO for miR-7132a-5p, 32 significantly enriched GO for miR-499a-5p and 28 significantly enriched GO for miR-1388-3p (Table S5). Within those GO of molecular functions and molecular process, many of them are involved in epigenetic regulation, mostly regarding histone methylation. Only the miR-499a-5p presented potential target genes in a GO directly related to sexual development: "Androgen receptor binding" (Table S5).

Dynamics of circulating miRNAs after an acute stress

The basal level of cortisol at T0 was 2.4 ±1.0 mg/ml (n=18; Fig. 3A). We observed a significant increase of cortisol at 0.5h (86.2 ±8.1 ng/ml, n=15, p-value = 1.4 x 10 -7 ) and 1.5h (126.0 ±25.7 ng/ml, n=15, p-value =

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint 9.7 x 10 -9 ) following the confinement stress. Six hours after de stress, cortisol level decreased, though the fish did not return to their basal level (47.5 ±7.5ng/ml; Fig. 3A). A total of 257 miRNAs, from the 21 samples sequenced, were annotated with Prost!. Results from a 2dimensional NMDS analysis yielded a stress level < 0.2 (stress = 0.11) and a noteworthy discrimination of control individuals from individuals of the T0.5 condition (Fig. 3B). The DESEQ2 analyses allowed to detect 30 miRNAs differentially expressed between T0 and T0.5; 14 miRNAs differentially expressed between T0 and T1.5; 29 miRNAs differentially expressed between T0 and T6 and 34 miRNAs differentially expressed between the T0.5 and the T6 conditions (Fig. 3B). Interestingly, the Venn diagram identified one miRNA (miR-200a-3p) as common for all comparison and was thus chosen for further qPCR validation (Fig. S3). We also purposely chose four other miRNAs from the above-described list. This choice was based on the fact that two of them: miR-155-5p and miR-205-1-5p (Fig. 4) followed the cortisol production dynamic, while another: miR-143-3p, presented an opposite pattern (Fig. 4). Indeed, the number of normalized counts between T0 and T0.5 significantly increased for miR-155-5p; miR-200a-3p and miR-205-1-5p whereas it decreased for the miR-143-3p (Fig. 4). Additionally, miR-223-3p was also selected because it presented positive linear correlation with cortisol production over time, and its expression was 2-fold higher at 6 hours post-stress compared to T0 (padj = 0.013; Fig. 4). significantly increased in the 30 minutes following the confinement challenge (padj = 9,81.10 -8 ; 5,65.10 -13 and 9,03.10 -12 , respectively).

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission. The profile of expression observed with small RNA-sequencing and RT-qPCR was similar for miR- 155-5p, miR-143-3p, miR-200a-3p and miR-223-3p but not for miR-205-1-5p (Fig. S4). To ensure that the miRNAs selected were effective markers, they were also tested by RT-qPCR but on other individuals (nonsequenced) from the same experiment. they presented the same profile on RT-qPCR to that observed by sequencing (Fig. 5). This was especially true for miR-205-1-5p that increased significantly at 1.5 hour following the stressful challenge (p-value = 0.006).

However, previous observations of the expression of miR-223-3p were not confirmed by RT-qPCR on those different samples (Fig. 5). In addition, the quantity of miR-155-5p was two low on these new samples for was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint being correctly interpreted (i.e. very high CTs), and was thus discarded from the analysis. RT-qPCR were done on non-sequenced samples collected at T0 (n=6), T0.5 (n=10), T1.5 (n=6) and T6 (n=8). Reference miRNAs used for RT-PCR relative quantification was miR-23b-2-3p. Different letter reveal a significant differences. The color code is associated with timing of sampling after the acute stress.

We focused only on those five miRNAs for the GO analysis. A total of 785, 739, 1146, 961 and 907 genes were predicted as potential target for respectively . For each miRNA, potential target genes were classified by their molecular function (MF) and biological processes (BP). On a total of 16368 possible biological processes in the European seabass, we detected only 118 significantly enriched GO for miR-155-5p, 70 significantly enriched GO for miR-143-3p, 155 significantly enriched GO for miR-200a-3p, 116 significantly enriched GO for miR-223-3p and 138 significantly enriched GO for miR-205-1-5p (Table S6). On a total of 20503 possible molecular functions in the European seabass, we detected only 28 significantly enriched GO for miR-155-5p, 23 significantly enriched GO for miR-143-3p, 26 significantly enriched GO for miR-200a-3p, 33 significantly enriched GO for miR-223-3p and 19 significantly enriched GO for miR-205-1-5p (Table S6).

Interestingly many pathways related to the primary (i.e. involving monoamine neurotransmitters and was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

corticosteroids release) and secondary (i.e. metabolism, hydromineral balance and cardiovascular functions) response to stress were pinpointed in the GO analysis (Table S6, Fig. 6). For instance, within those GO of biological process, many of them are involved in the stress response: "hormone-mediated signaling pathways" (including key genes such as glucocorticoid receptor, nr3c1 and sirtuin, sirt1) for miR-143-3p; "response to steroid hormones" (including the mineralocortoid receptor, nr3c2) for miR-155-5p; "response to monoamines, catecholamine, dopamine" for miR-205-1-5p; "response to hormones" for miR-200a-3p and "regulation of response to stress" for miR-223-3p (Fig. 6). We also identified potential target genes involved in 1) behavioural response :"regulation of behaviour", "social behaviour"; "regulation of locomotion" 2) regulation of blood pressure : "regulation of heart rate", "angiogenesis", "blood vessel development", "heart development"; and 3) energy balance: "glycogen metabolic process", "response to lipid", "lipid modification", "response to glucose", "energy reserve metabolic process", "response to insulin", "negative regulation of protein metabolic process" (Table S6, see Fig. S5 for a detailed list of selected GO of biological processes, miRNA per miRNA).

was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint

Discussion

In this study, we investigated the potential of miRNAs as biomarker of sex and stress on the basis of a simple blood collection on the European seabass. We divided the research in two parts: searching for (i) sex markers and (ii) acute stress markers. Various miRNAs were modulated by the fact of being male or female, or by an acute stress.

Here, we identified eleven miRNAs interesting for sexing immature European seabass, three of them being strongly differentially expressed between sexes miR-1388-3p, miR-7132a-5p and miR-499a-5p. Among them, the miR-499a-5p, more detected in males, was likely the more interesting because of the similar profile obtained by RT-qPCR. In human, high level of circulating miR-499a is associated with early detection of breast cancer in women, while low levels were detected in cells of men with prostate cancer (Y. [START_REF] Chen | MiR-499a inhibits the proliferation and apoptosis of prostate cancer via targeting UBE2V2[END_REF][START_REF] Kabirizadeh | The SNP rs3746444 within mir-499a is associated with breast cancer risk in Iranian population[END_REF], suggesting a conserved role in steroid regulation. A recent study on zebrafish detected significantly more miR-499-5p in testis than in ovaries [START_REF] Van Gelderen | Deciphering sex-specific miRNAs as heat-recorders in zebrafish[END_REF]. Yet, studies on other fish species have identified that miRNAs from the miR-499 family are involved in slow muscle phenotype determination [START_REF] Duran | Rainbow trout slow myoblast cell culture as a model to study slow skeletal muscle, and the characterization of mir-133 and mir-499 families as a case study[END_REF] and the miR-499a-5p is key in regulating Sox6 (Sex determining region Y-box 6) activity [START_REF] Nachtigall | MicroRNA-499 Expression Distinctively Correlates to Target Genes sox6 and rod1 Profiles to Resolve the Skeletal Muscle Phenotype in Nile Tilapia[END_REF][START_REF] Wang | Prdm1a and miR-499 act sequentially to restrict Sox6 activity to the fast-twitch muscle lineage in the zebrafish embryo[END_REF]. Interestingly, in the European seabass, the 3'UTR sequence of sox6 also have two possible 8-mer recognition sites for miR-499a-5p and sox6 is significantly more expressed in the gonads of females experiencing molecular sex differentiation, compared to the gonads of males [START_REF] Geffroy | Unraveling the genotype by environment interaction in a thermosensitive fish with a polygenic sex determination system[END_REF]. This would support the possible repressive action of miR-499a-5p on sox6, though the exact mechanisms still remain to be established.

Finally, the genes kdm1a (Lysine-specific histone demethylase 1A) and prkcb (Protein kinase C beta type) belonging to the GO "Androgen receptor binding" are also possible target for miR-499a-5p, supporting a possible role in sexual development. More studies are necessary to really depict the role of miR-499a-5p and understand why this miRNA is more detected in males' plasma compared to females' plasma.

Regarding miR-1388-3p (overexpressed in females of our experiment), this miRNAs was also more detected in ovary of Paralichthys olivaceus relative to testis [START_REF] Yang | MiR-1388 regulates the expression of nectin2l in Paralichthys olivaceus[END_REF]. Furthermore, miR-1388-5p is involved in the regulation of the Spin-1 gene, which is important for hormone control, gametogenesis, and oocyte meiotic resumption in rainbow trout (F. [START_REF] Wang | Abnormal expression of miR-1388-5p and its target spindlin-1 in female triploid rainbow trout (Oncorhynchus mykiss)[END_REF]. Finally, the miR-7132a-5p (overexpressed in females of our experiment), was found to be up-regulated Cynoglossus semilaevis in pseudomales (ZW) compare to males (ZZ) (Zhao et al., 2021). In addition, the -3p strand of the miR-7132a was found to be up-was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint regulated in the juveniles' gonads of the common carp exposed to atrazine (F. [START_REF] Wang | Effects of short-time exposure to atrazine on miRNA expression profiles in the gonad of common carp (Cyprinus carpio)[END_REF]. It should be noted that none of the miRNAs tested in qPCR (in individuals that were not sequenced) were detected as significantly different between males and females, which might be due to the low quality of the RNAs used.

Regarding fish, our experiment corroborates observations of other studies conducted on gonads (miR-499-5p and miR-1388-5p), even though we were astonished to not identify other "usual suspects" involved in sexual development such as miR-202, which is highly sex-specific in the gonads of many other fish species [START_REF] Geffroy | Sexually dimorphic gene expressions in eels: Useful markers for early sex assessment in a conservation context[END_REF][START_REF] Juanchich | Characterization of an extensive rainbow trout miRNA transcriptome by next generation sequencing[END_REF][START_REF] Qiu | Identification and expression analysis of microRNAs in medaka gonads[END_REF][START_REF] Shen | Expression, localization, and a regulated target gene (ccnd1) of miR-202-5p in the Japanese flounder gonads[END_REF][START_REF] Zhang | MiR-202-5p is a novel germ plasm-specific microRNA in zebrafish[END_REF] or statistically differentially expressed between the two gonads [START_REF] Gay | MiR-202 controls female fecundity by regulating medaka oogenesis[END_REF][START_REF] Zhang | MiR-202-5p is a novel germ plasm-specific microRNA in zebrafish[END_REF]. This might simply transduce that the miRNAs detected in the plasma does not specifically mirror what happen in other organs.

In that sense, the recent study of Cardona and colleagues compared the miRNA repertoire of various body fluids or tissues of the rainbow trout and highlighted a large differences in the identity of the miRNAs observed in plasma compared to ovarian fluids [START_REF] Cardona | Circulating miRNA repertoire as a biomarker of metabolic and reproductive states in rainbow trout[END_REF]. Another explanation could be that miRNAs found in the plasma at a specific moment transduce a punctual physiological state at this moment, rather than a long-term phenotype (e.g., sex). This would explain why miRNAs related to stress were more reliably found in qPCR compared to those related to sex.

For the stress experiment, we first characterized the stress response of our fish, when exposed to confinement. This was highly challenging since the European seabass has often been regarded as a species with relatively high basal cortisol levels compared to other species [START_REF] Alfonso | Water temperature explains part of the variation in basal plasma cortisol level, within and between-fish species[END_REF]. When considering individuals encompassing the same mass range (20-60 mg) the basal level varied between 14 and 80 ng/mL in other studies using a comparable ELISA quantification method [START_REF] Cerqueira | Cognitive appraisal in fish: Stressor predictability modulates the physiological and neurobehavioural stress response in sea bass[END_REF][START_REF] Tsalafouta | Early life stress and effects at subsequent stages of development in European sea bass (D. labrax)[END_REF]. Here, the level of cortisol was as low as 2 ng/ml, ensuring that we successfully obtained a reliable basal level of unstressed fish. To our knowledge, our study is the first to report a long term (6 hours) miRNA production dynamic following an acute stress in a fish species. A recent study described that 10 miRNAs were modulated one hour following an air exposure challenge in rainbow trout, in distinct non-lethal biological matrices (water, mucous and plasma ; [START_REF] Ikert | High Throughput Sequencing of MicroRNA in Rainbow Trout Plasma, Mucus, and Surrounding Water Following Acute Stress[END_REF]. Here, the confinement stress affected the expression of 14 and 30 miRNAs at 0.5 and 1.5 hours post-stress, respectively. However, none of the miRNAs detected were similar to that of the [START_REF] Ikert | High Throughput Sequencing of MicroRNA in Rainbow Trout Plasma, Mucus, and Surrounding Water Following Acute Stress[END_REF] study. We could thus not tease out a specific effect of the stress applied or of the species studied, as pinpointed in a recent review [START_REF] Raza | MicroRNAs mediated environmental stress responses and toxicity signs in teleost fish species[END_REF]. For instance, miR-210-3p has been associated with hypoxic stress in the rainbow trout [START_REF] Cardona | Tissue origin of circulating microRNAs and their response to nutritional and environmental stress in rainbow trout (Oncorhynchus mykiss)[END_REF] and was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint miR-276b-3p was shown to be upregulated following a salinity stress challenge in Portunus trituberculatus (X. [START_REF] Chen | Transcriptional responses to lowsalinity stress in the gills of adult female Portunus trituberculatus[END_REF]. Among miRNAs that we observed differentially expressed during stress recovery, we purposely chosen to focus on miR- 155-5p, miR-143-3p, miR-200a-3p, miR-223-3p and miR-205-1-5p to conduct the RT-qPCR validation part. This choice was mainly based on their potentially interesting targets (discovered thanks to TargetScan) following a stress. At the physiological level, the stress response is conducted by the central nervous system, and led to a secretion of neurotransmitters and stress hormones that constitute the first stress response [START_REF] Schreck | The Concept of Stress in Fish[END_REF]. The second response involve the secretion of energetic metabolites (glucose, lactate..), the modulation of osmoregulation and immune response, while the third response lead to drastic changes in performances (decrease of growth, disease resistance, behavioral change ..). Interestingly, the GO analysis allowed us to provide some hypothesizes regarding the downregulation of key genes involved in the first two stages of the stress response. For instance, we identified the glucocorticoid receptor (gr or nr3c1) as potential target of miR-143-3p in silico. Such a link would make sense since 1) miR-143-3p is highly expressed at T0 compared to other time-points, supporting a possible production of GR post-stress and 2) gain-and loss-function approaches in GR and miR-143-3p confirmed that the glucocorticoid receptor was indeed a target of miR-143-3p in humans (L. [START_REF] Zhang | GR silencing impedes the progression of castration-resistant prostate cancer through the JAG1/NOTCH2 pathway via up-regulation of microRNA-143-3p[END_REF]. This support a specific role of miR-143-3p in the primary stress response. MiR-155-5p and miR-200a-5p, observed in the mid-intestine, are mainly involved in the response to an oxidative stress of the Wuchang bream, Megalobrama amblycephala [START_REF] Song | MiR-144 is the epigenetic target for emodin to ameliorate oxidative stress induced by dietary oxidized fish oil via Nrf2 signaling in Wuchang bream, Megalobrama amblycephala[END_REF]. It is worth noting that the mineralocorticoid receptor (mr or nr3c2), a potent receptor of cortisol [START_REF] Prunet | Multiple corticosteroid receptors in fish: From old ideas to new concepts[END_REF], is a potential target of miR-155-5p in our in silico analyses, supporting its possible role in the regulation of stress response. The miR-223 was also associated to the modulation of oxidative stress response in the Nile tilapia [START_REF] Tang | Effects of vitamin E on expressions of eight microRNAs in the liver of Nile tilapia (Oreochromis niloticus)[END_REF]. We observed that the miR-205-1-5p was the only one to show a statistical and steadily increase of its relative expression following the confinement stress. Our predictive analysis, using TargetScan Human, allowed to detect several pathways related to stress such as "regulation of response to stress", energy balance, such as "response to insulin", "lipid modification" as well as "angiogenesis" and "negative regulation of blood circulation". In human model, miR-205-5p regulates the VEGFA-angiogenesis [START_REF] Oltra | Oxidative stress-induced angiogenesis is mediated by miR-205-5p[END_REF], supporting a role in the secondary stress response. In fish studies, miR-205-5p was also detected following stressful events like heat stress or hypoxia [START_REF] Lai | Hypoxia alters steroidogenesis in female marine medaka through miRNAs regulation[END_REF][START_REF] Liu | MiRNA and mRNA expression analysis reveals the effects of continuous heat stress on antibacterial responses to Aeromonas hydrophila lipopolysaccharide (LPS) in grass carp (Ctenopharyngodon idella)[END_REF].

Challenges reported in diagnostic of human cancer are linked to technical issues and individual-related parameters that could influence the presence/absence of circulating miRNA [START_REF] Tiberio | Challenges in Using Circulating miRNAs as Cancer Biomarkers[END_REF]. In this was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint 20 review, authors reported the various technical parameters (hemolysis, anticoagulant used, extraction method, miRNA measurement, data normalization) that could explain the differences in studies outcomes. Here, we also detected many limitations that are likely explained by differences in the quality of the samples, since for those of high-quality, small RNA-seq was confirmed by qPCR, but not for samples of apparently lower quality. Finally, a major difference between our study and the vast majority of the above-mentioned studies is that most of the other authors worked on tissues to identify the modulation of miRNA content in response to a stress or a physiological status. In fishes, miRNAs have been identified in several matrices, including nonlethal ones such as plasma, mucus, water and feces. Here we focused on plasma, that directly reflect the physiological state of an individual and this opens new perspectives of use and application to follow natural and captive livestock. Following the stressful challenge, we identified several key miRNAs that are readily released in blood (increasing in the 30 min after stress event) and return to their basal level in few hours.

However, the information gathered highlighted that this method is likely too precise to provide cues on the sex, as it will rather indicates a physiological state linked to the gonadal development stage.

Fig. 1

 1 Fig. 1 Summary of the two experiments conducted to identify (A) sex and (B) stress markers. The number in brackets represent the number of fish used

Fig. 2

 2 Fig. 2 Normalized counts of circulating miRNAs based on A) small RNA-seq and B) RT-qPCR of sequenced samples. Reference miRNA used for RT-PCR relative quantification was the miR-23b-2-3p. NS: nonsignificant, *: p<0.05, **: p<0.01 and ***: p<0.001

Fig. 3

 3 Fig. 3 (A) Cortisol (ng/mL) quantified in plasma of European seabass after an acute stress of confinement and (B) Non-metric multidimensional scaling (NMDS) of miRNAs differentially expressed between various time points after confinement stress. Numbers in brackets corresponded to the number of samples used for sequencing. On NMDS, points represent individuals, diamonds represent the centroid value for each condition and the red line represent the fitted cortisol value.

Fig. 4

 4 Fig. 4 Normalized counts of miRNAs differentially expressed in plasma of European seabass after exposure to a confinement stress. Different letters reveal a significant difference. The color code is associated with timing of sampling after the acute stress.

Fig. 5

 5 Fig. 5 Relative expression profile of four miRNAs in plasma of European seabass after a confinement stress.

Fig. 6

 6 Fig. 6 Key pathways of genes potentially targeted miR-143-3p, miR-205-1-5p, miR-155-5p, miR-200a-3p and miR-223-3p. The different colors are associated with the level of expression of each miRNA at each time point. See Fig. 4 and Fig. 5 for the description of colors code used.

  After one hour of incubation, each well was washed and filled with the substrate. Absorbance was was not certified by peer review) is the author/funder. All rights reserved. No reuse allowed without permission.

	5%, cortisone 15.7%, 11-deoxycortisol 15.0%, prednisone 7.83%, corticosterone 4.81%, 6β-hydroxycortisol 1.37%, 17-hydroxyprogesterone 1.36%. Following manufacturer's instructions, samples or standard (Cortisol standard solution) were added in each well in duplicate and supplemented with the conjugated cortisol enzyme. The copyright holder for this preprint (which this version posted July 3, 2023. ; https://doi.org/10.1101/2023.07.03.547501 doi: bioRxiv preprint

Acknowledgments

The authors would like to acknowledge the team from Station Ifremer Palavas-les-Flots (France) and the team from Aquanord Gloria Maris (France) for the help in different sampling. The authors also thank Pierre Lopez for the sea bass infographic.

Funding Information

This work was funded by a grant from the European Maritime Affairs and Fisheries Fund (MiRNAs sex & stress, MiSS n°20-00070).

Data accessibility

All data generated or analyzed during this study are included in this article and supplementary information.

Conflict of interest

The authors declare no conflict of interest.

Author Contribution


domain: info math

text:
Maurice Clerc
email: maurice.clerc@writeme.com

What could a Quantum PSO be?

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Part I

Playing with qubits, gates and states In this discussion, we focus solely on the pure mathematical approach to quantum methods, excluding any physical interpretation. This is particularly important due to the existence of multiple interpretations, with no consensus on determining the "correct" one.

Technically speaking, a quantum method can be delineated through manipulations of qubits using operators, often referred to as gates, which are essentially unitary matrices 1 . I assume you are familiar with these concepts, but you can refer to the Appendix 6 for a more detailed explanation.

Alternatively, a quantum method can be depicted as a quantum circuit, where a computation involves a series of quantum gates and measurements (D. C. Marinescu and G. M. Marinescu 2012). Notably, the circuit may exhibit dynamic behavior, with certain qubits being reset and reused [START_REF] Hua | Exploiting Qubit Reuse through Mid-circuit Measurement and Reset[END_REF].

1 I assume you know what they are but you may have a look at the Appendix 6 2 A quantum algorithm operates by altering the components of a set of qubits so that the nal measurement yields a binary sequence that is most likely the desired outcome. Generally, it is assumed that all qubits start in the state |0|.

The primary challenge lies in executing these modications "blindly" since observing or measuring a qubit results in its destruction, providing only a binary outcome of 0 or 1.

Binary function, Boolean function

The usual denition of a binary function is a function that can takes only two values: 0 and 1, no matter what are the variables.

For a Boolean function, the variables can take only two values, True and False and the value of the function is dened by logical manipulations of these variables. But for such a function, you can not dene something like sin(True).

So, in what follows, a binary function is simply any function dened on {0, 1} D .

A simple example

Let us promptly provide an illustration based on the W states (Wikipedia 2023).

Our objective is to construct all m×n binary matrices A that contain exactly one '1' in each row.

There are at least three methods to achieve this:

1. A conventional approach utilizing a deterministic (potentially recursive)

algorithm. This poses a stimulating exercise that you should attempt.

2. A stochastic method involves minimizing a tness function, such as m i=1 n j=1 A (i, j) -1 on {0, 1} mn .

3. A quantum approach involves simultaneously generating all these matrices.

Method 1 is deterministic, making it arguably the superior choice. Method 2, on the other hand, may encounter signicant challenges in generating all possible solutions. Now, let's delve into the details of the latter. The diagram labeled 1.1 illustrates the corresponding quantum circuit for the parameters m = 3 and n = 2. It's worth noting that the standard convention involves numbering the qubits starting from 0. This circuit accurately produces the 2 3 = 8 solutions, requiring the utilization of three types of unitary operators (commonly referred to as gates when visually represented). The M box serves to signify that the qubit is measured, leading to its destruction, and the outcomeeither 0 or 1is recorded as a classical bit.

Result

If we display the state vector (i.e. the superposition of the eight states) just before measure, which is possible only in a simulation on a classical computer, not on an actual quantum device, we nd

  0 1 1 0 1 0   2 Grover Adaptive Search
This is a classical quantum optimizer [START_REF] Baritompa | Grover's Quantum Algorithm Applied to Global Optimization[END_REF] Ortega Ballesteros 2021). We consider here only for further comparison with our quantum PSO on a simple problem which I'll refer to as G6 and dened as follows (see also Figure 2.1 for a possible 1D landscape

2 ). There are many local optima but it is relatively easy to escape them for they contains at most two points and even often just one.

Find the binary position x = (x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ) of length n = 6 that minimizes 2 There are 2 6 = 64 possible strings, so 64! such landscapes f (x) = -15

+ n-1 i=1 (4 -x i -2x i+1 + x i x i+1 ) (2.1)
The problem, can be resolved using ten qubits.

It requires six qubits to represent positions, along with m qubits for the possible values of a position (more precisely the dierence relatively to a variable threshold). If the maximal value is f max theoretically mshould be so that f max ≤ 2 m-1 -1

Here f max = 5, so we have m = ⌈log 2 (5) + 1⌉ = 4

Let s be the number of solutions. The optimal number of iterations for the Grover search is given by r = π 4 1 arcsin s 2 n+m As we are not supposed to know there are more than one solution we set s = 1 and the formula gives r = 25. We will use this value but, actually there are two solutions and 17 would be better, because the eciency (the probability of success) follows a sin 2 law: too few iterations certainly reduces it but too many may also reduce it.

By running the Qiskit code (given in the Appendix 8.1) we indeed nd the two solutions, on positions x = (0, 0, 0, 0, 0, 0) and (0, 1, 1, 1, 1, 1) for which the f value is -5 (see the gure 2.2). By combining dierent strategies it is possible to dene many binary PSO variants [Maurice Clerc 2005). But to illustrate the transformation classical ⇒ quantum let us consider just the oldest one [START_REF] Kennedy | A discrete binary version of the particle swarm algorithm[END_REF]. Of course more sophisticated variants do exist (see for example [START_REF] Lee | Modied binary particle swarm optimization[END_REF].

A classical binary PSO

The problem is dened by a tness function f on {0, 1} D and a position x is said to be better than a position y i f (x) < f (y).

The velocity update formula is

v i,(t+1),d = wv i,t,d + ci,t,d (p i,t,d -x i,t,d ) + ci,t,d (g i,t,d -x i,t,d ) (3.1)
and the position update formula 3

x i,(t+1),d = 1 -x i,t,d if U (0, 1) < S v i,(t+1),d 0 else (3.2)
where w is the inertia weight i is the rank of the particle in the swarm of size N . t is the time step. d is the current dimension. Note that terms like p -x and g -x can take only three values: -1, 0 and 1. ci,t,d is a random positive number generated for each (i, d, t), whose upper limit is an undened parameter. Usually drawn from the uniform distribution.

x i,t = (x i,t,1 , . . . , x i,t,D ) the position of the particle i at time t, an element of {0, 1}

v i,(t+1),d → max min v i,(t+1),d , V max , -V max (3.3)
Only later the constriction coecient made it possible to avoid this arbitrary parameter (M. [START_REF] Clerc | The particle swarm -explosion, stability, and convergence in a multidimensional complex space[END_REF]. In [START_REF] Kennedy | A discrete binary version of the particle swarm algorithm[END_REF] V max is set to 6.

p i,t = (p i,t,1 , . . . , p i,t,D ) the best position found so far at time t by the particle i, usually called previous best.

g i,t = (g i,t,1 , . . . , g i,t,D ) the best of the best positions found so far at time t by the neighbors of the particle i.

U (0, 1) a random value drawn from the uniform distribution on [0, 1]. S a logistic transformation that maps ]-∞, +∞[ to ]0, 1[:

S (u) = 1 1 + e -λu (3.4)
for which λ = 2 seems to be a good choice. The idea is that if for a dimension d the velocity is high then the d-th bit of the position should probably be switched.

The mapping function S can easily be modied. Not clear whether there exists a best one or not, though.

The neighborhood N i of the particle i is dened by what is called topology and there are many possible ones, either constant, variable or adaptive.

At each time step and for each particle i we apply the velocity update and the position update formulae and then we take the tness function f into account to possibly update the previous best

p i,(t+1) = x i,(t+1) if f x i,(t+1) < f (p i,t ) = p i,t else (3.5)
and the best previous best in the neighborhood g i,(t+1) = arg min j∈Ni f p j,(t+1)

(3.6)
In what follows, for simplicity I use rst the so called global topology: for each particle the neighborhood is the whole swarm so there is just one g.

Quantum Imitation

We can try to mimic classical PSO with quantum operations. Actually this is a hybrid approach. The main idea is Replace bits by qubits, but some classical computations are still needed. There are two diculties:

we can not precisely know a position; apparently we can not write something as simple as p i = x i for cloning an unknown quantum state is impossible.

To cope with the rst one, we estimate the probability density by launching many shots with measure. The second one is due to an easy to prove theorem [START_REF] Wootters | A single quantum cannot be cloned[END_REF]. However we do not really care here for several reasons:

It is not valid if you know the state, particularly after a forced (re)initialization.

Similarly to the No Free Lunch theorem, which is valid only on sets of problems that are closed under permutations, a situation that never occurs in practice, this one is valid only for pure quantum states, not mixed ones (see the Appendix for denitions) that usually have to be used if you want to take advantage of the main quantum properties (superposition, entanglement).

An imperfect cloning (quasi-copy) is always possible [START_REF] Buºek | Quantum copying: Beyond the nocloning theorem[END_REF]Hillery 1996, Mastriani 2022).

Finally, the no-cloning theorem holds true only when all applicable operators are unitary. When, for instance, a qubit is reset, not only is its state revealed, but the associated operator is no longer unitary. In such instances, it becomes feasible to eectively copy a qubit, a process we will apply in the subsequent discussion. Note that, though, it implies that the quantum device can perform qubit resets.

Velocity and position updates

For each i in {1, . . . , N } we dene two lists of qubits that can be called qparticles:

x i = (x i,1 , . . . , x i,D ) for the positions, i.e. the explorer swarm; p i = (p i,1 , . . . , p i,D ) for the previous best positions, i.e. the memory swarm.

In the formula 3.1 a term like p i,t,d -x i,d can be interpreted as how much the qubits p i,d and x i,d are dierent, and depending on its sign it will implies attraction or repulsion.

The closeness between them can be evaluated by the delity in [0, 1] (see the Appendix 6) and therefore the distance by 1-delity which is in [0,1].

But as we want a value that can be either positive or negative we use in fact

1 -2 × f idelity, which is in [-1, 1]. The formula 3.1 becomes v i,d ⇐ wv i,d + ci,d 1 -2 ||p i,d x i,d || 2 + ci,d 1 -2 ||g d x i,d || 2 (4.1)
Then we apply a modied mapping so that the result is in [-1,1]:

S (u) = 2 1 + e -λu -1 (4.2)
From a quantum point of view the formula 3.2 has to be transformed

x i,(t+1),d = R y (πS (v i,d ) , x i,d ) (4.3)
Why this rotation? Let's consider the extreme case

x i,d = 1 × |0 > +0 × |1 > and S (v i,d ) (almost)
v max = c 1 -w (4.4)

Global best version

For simplicity we use here the global best topology (although it is bad for classical multimodal problems).

The formula 4.3 becomes

v i,d ⇐ wv i,d + ci,d 1 -||g d x i,d || 2 (4.5)
We consider the qubits independently. Remember that each x i,d can be written

x i,d = α|0 > +β|1 >
Note that we do not even need to use complex numbers.

A pseudo-code is given in the box 1. To be sure you can reproduce the experiments a Qiskit code for simulation (version 0.44.1) is given in the Appendix 8.3.

On a simulation we could have access to the state vector. However it would be a sort of cheating for it is not possible on a real quantum device. So , instead, I run many times the circuit (shots) to build a quasi-distribution, which can be seen as an estimation of the unknowable state vector. Of course, it means that the accuracy of this estimation is depending on the number of shots. In the code of the Tools there is a function that estimate the number of shots for a desired accuracy (say 0.95), but it can not work as soon as the number of qubit is too big. We can test this algorithm with two or three q-particles on a few simple functions.

Sin3 problem

The continuous form of the tness function is dened on [0, 7] by

f (x) = sin (x) (1 -x) (4.6)
It is bimodal as we can see on the gure 4.1.

We convert it into a binary one dened on {0, 1} 3 thanks to the binarization technique (see the Appendix 7)

f (b 0 , b 1 , b 2 ) = sin (b 0 + 2b 1 + 4b 2 ) (1 -b 0 -2b 1 -4b 2 ) (4.7)
The solution is f (1, 1, 1) = -3.942. During a run a sequence of improvement can be for example [0.0, 0.0, 1.3970, -3.9419].

(s i ) if f (s i ) < f p,i x best = s i f p,i = f (s i ) copy x i to g
A circuit (with just two q-particles) is given on the gure 4.2. Note the three CX gates that copy the best position (the rst one) to the global best.

G6

Binary Rastrigin

We dene the continuous function on [0, 7] 2 by

f (x 1 , x 2 ) = 20 + (x 1 -3) 2 -10 cos (2πx 1 ) + (x 2 -5) 2 -10 cos (2πx 2 ) (4.8)
This function is highly multimodal as we can see on Figure 4.3a. The minimum is zero on (3,[START_REF] Lee | Modied binary particle swarm optimization[END_REF].

When considering only integer 2D points it is unimodal (gure 4.3b) but the algorithm doesn't know that. Actually it is not really aware of any landscape but we can better understand why the problem is far more dicult 5 than G6 although the dimension is the same ( 6) by looking at a possible 1D landscape (gure 4.3c) whose local optima contain seven points, instead one or two for G6.

The algorithm proposes as a solution the binary string (101011) = 43. As Qiskit uses the little-endian notation we can reverse the string and if we split it we indeed get (110, 101) = (3, 5).

5 Inversely, it's a good example of a problem that becomes simpler when coded in higher dimension. The algorithm is still hybrid and needs more qubits than for the global best topology, (2N D vs (N + 1)D) .

The Qiskit code is given in the appendix 8.4. It is a of course longer than the one for the global best approach.

Discussion

The above results are not particularly good, even if better than with random search. They are far worse than with exhaustive search, that would need 2 D evaluations, i.e. 64 for D = 6. Of course the hope is that it would be dierent for higher D values.

Although only very simple examples has been treated it seems that, contrarily to the continuous case, the local best topology is not more ecient than the global best one. As it needs less qubits the global best topology seems preferable but, of course, more and bigger examples are needed to conclude. But is it worth?

These two approaches do use qubits and quantum gates (H , CX and R y ) but are not satisfying for at least three reasons:

Not elegant, for they are hybrid methods.

They need a lot of qubits. The Grover search needs less qubits. However its Qiskit code used here works well only for Quadratic unconstrained binary optimization (QUBO) but not, for example, on the Rastrigin problem 6 .

They don't truly leverage specic quantum features such as entanglement and superposition. Therefore, in reality, both of them are essentially just another instance of "fake quantum PSO."

For the classical iterative approach let's temporarily call state a position in the search space.

The philosophy of this approach is then Progressively nd a state better than the previous one.

But for the quantum approach it is Progressively increase the probability of desirable states.

They appear similar, but they dier, as evident in this study when comparing Grover's approach with our "quantum" PSO ones.

When we assert that a position is represented by a set of qubits, a qparticle, it implies that this q-particle essentially represents all potential po- To simplify calculations the qubit 1 0 is noted |0 > and the qubit 0 1

is noted |1 >. This is the so called bra notation.

A notation like |010 > means we consider the tensor product |0 > ⊗|1 > ⊗|0 > and is a state. This is then a column vector of size 2 3 . A notation like |ψ > is a concise way to say that ψ is a complex column vector (of any dimension) as the ket notation < φ| is a complex row vector, a linear form, actually.

Inner product

Applying a ket to a bra is the inner product < φ||ψ > noted < φψ > and the result is a complex number. In particular we assume < ψψ >= 1, which is a generalisation of the formula 6.2.

Outer product

Applying a bra to a ket is the outer product |ψ >< φ| noted |ψφ| and the result is a matrix (product of a column vector by a row vector).

Qubits are manipulated thanks to unitary matrices, usually called operators or gates.

H gate

The name comes from Hadamard. This gate places the qubit in the intermediate state, which would give 0 or 1 with probabilities equal to 1/2, if measured.

Such a gate therefore induces the transformation

|0 > → |0 > +|1 > √ 2 = 1 √ 2 1 1
In matrix representation, we have

H = 1 √ 2 1 1 1 -1 (6.3)
It also induces the transformation

|1 > → |0 > -|1 > √ 2 = 1 √ 2 1 -1
It is often used as the analogue of the classic uniform random initialization in population-based algorithms, when all qubits at the very beginning are in state |0 >.

X gate

X for ex change. Sometimes called Pauli-X or NOT gate or bit-ip.

When a qubit `passes' through such a gate, it becomes, as it were, its opposite: |0 > becomes |1 > and |1 > becomes |0 > . More generally α and β components are exchanged.

Its matrix is

X = 0 1 1 0 (6.4)
and to apply this gate is to perform the product

X × α β = β α
This is the analogy of Not in classical computing.

CX gate

CX for controlled ex change.

It is also called CNOT because it is indeed a controlled 'negation'. This gate concerns two qubits. When the rst one is |1 > an X gate is applied to the second one. But if it is |0 > the X gate on the second one is ignored. So the matrix is now 4 × 4 :

CX =     1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0     (6.5)
From an algebraic point of view, applying this gate consists of forming a four-element ψ vector by concatenating 'vertically' those of the two qubits, then performing the product

CX × ψ =     1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0         α 1 β 1 α 2 β 2     =     α 1 β 1 β 2 α 2    
In a circuit, this gate is often represented as

Ry gate

This operator needs a parameter θ called rotation angle. Its matrix is

R y (θ) = cos θ 2 -sin θ 2 sin θ 2 cos θ 2 (6.6)
In the so-called Poincaré-Bloch sphere visualization it rotates around the y axis the vector representing the qubit to which it is applied, hence the name.

Pauli Z gate

This is a single-qubit rotation through π radians around the z-axis. Sometimes also noted σ z . Its matrix is

Z = 1 0 0 -1 CZ gate
The controlled Z gate, applied to two qubits. Although it is called controled one can not really say that a qubit controls another one so its graphical representation in a circuit is symmetrical:

Its matrix is CZ =     1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 -1     (6.7)
In fact, of the four possible input states, namely |00 >, |10 >, |01 > and |11 >, only the last one is modied, transformed into -|11 >.

Pure state, mixed state

A pure state can be represented by a vector. Qubits are pure states. However, most of the time, after some manipulations the current state is a linear combination of pure states, and is dened by a matrix, as we have seen for the H gate. However, in practice, it is easier to explicitely give the linear combination, On a simulation we can eectively display the state, but not on a real quantum device.

Any quantum algorithm has to change the probabilities without being able to see them, in order to favour the desirable states before measure.

Density operator

Let us consider an ensemble of pure states ψ j prepared with probabilities p j (of sum 1). Then the density operator is dened by

ρ = j p j |ψ j ⟩ ⟨ψ j |
Note this is a matrix.

Fidelity

If you consider states as probabilistic distributions, a classical estimation of the closeness of two states φ and ψ is the delity based on the density operator.

If the states are pure the formula is simply

F (φ, ψ) = tr √ ρσ √ ρ 2 ) = (tr (| √ ρσ|))
2 where tr is the trace of a matrix ρ is the density operator of φ σ is the density operator of ψ

Although not obvious the delity is symmetrical. However it is not really a distance (no triangle inequality).

For pure states the formula is simply

F (φ, ψ) = |< φ|ψ >| 2
Let's consider the particular case of two qubits

q 1 = α 1 β 1 and q 2 = α 2 β 2 .
The delity is simply

F (q 1 , q 2 ) = |α * 1 α 2 + β * 1 β 2 | 2 (6.9)
where * means conjugate. Its value in [0, 1] tell us how similar are these two qubits. For example if a qubit is set to |0> and the other initialized thanks to a H gate, the delity is 0.5. But if they are both initialized by H the delity is 1.

Binarization

Let's consider a real function f dened on S = [x min , x max ] whose minimum is on x * . If it is an articial problem of a benchmark for optimization it is alway possible to modify it so that x min = 0 and x * is an integer. So if x max ≤ 2 n the number of bits to represent in base 2 all integers of the search space S is n -1. Now each integer x of S can written

x = n-1 i=0 b i 2 i (7.1)
For example the continuous function

f (x) = (1 -x) 2 on [0, 7]
becomes (we keep the same name for simplicity)

f (b 0 , b 1 , b 2 ) = (1 -b 0 -2b 1 -4b 2 ) 2 on {0, 1} 3
and its minimum is 0 on (0, 0, 1).

Of course this transformation can be extended to more than one dimension. -------------- print("Minimum ",fmin," on ", solutionMin,sep="") print("Maximum ",fmax," on ", solutionMax,sep="") vu=np.unique(v) print("Possible values") print(vu) print("There are ",len(vu)," possible values",sep = "") end=time.process_time() print("Exhaustive search time = ",end-start,sep="") #---------------------Grover print("n = ", n, ", m = ", m,", nbqubits = ", nbqubits,sep = "") print("nbIter = ",nbIter) # ------------------------Grover's adaptive search if nbqubits<10: # Can run locally on a small laptop from qiskit.primitives import Sampler grover_optimizer = \ GroverOptimizer(nbqubits, num_iterations=nbIter, \ sampler=Sampler())

else: # IBM quantum cloud.

# The needed API token has been saved once on the local computer from qiskit_ibm_runtime import Sampler from qiskit_ibm_runtime import QiskitRuntimeService service = QiskitRuntimeService(channel="ibm_quantum") backend = service.backend("ibmq_qasm_simulator") grover_optimizer = GroverOptimizer(nbqubits, num_iterations=nbIter, \ sampler=Sampler(backend=backend)) results = grover_optimizer.solve(qp) end=time.process_time() print("Exhaustive search time = ",end-start,sep="") print(results.prettyprint()) # - -----------------------Post ------------------------------------------------------ p r i n t ( n s h o t s , " n s h o t s " ) n b i t s = n q b i t s # To s a v e t h e f i t n e s s v a l u e p r i n t ( " n q b i t s " , n q b i t s ) a l l q b i t s = l i s t ( r a n g e ( n q b i t s ) ) p r i n t ( n q b i t s , " q u b i t s " ) p r i n t ("==========================", " I t e r a t i o n " , t ) q = Q u a n t u m R e g i s t e r ( n q b i t s ) c = C l a s s i c a l R e g i s t e r ( m e a s u r e d ) q c = Q u a n t u m C i r c u i t ( q , c ) i f t == 1 : p r i n t ( " A f t e r " , t , " i t e r a t i o n s : " ) p r i n t ( " and " , FEs , " e v a l u a t i o n s " ) p r i n t ( x B e s t , " =>", f M i n ) p r i n t("============================= F i n a l r e s u l t " ) p r i n t ( " F u n c t i o n " , f C o d e )

b1 = x [ 1 ] b2 = x [ 2 ] f = (1 =2*b0=4*b1+b2 ) * * 2 * (3=b0 =2*b1+b2 ) c a s e 5 : # G4 b1 = x [ 1 ] b2 = x [ 2 ] b3 = x [ 3 ] f = =11+(4=b0=2*b1+b0*b1 ) + (4=b1 =2*b2+b1*b2)+(4=b2=2*b3+b2*b3 ) c a s e 5 1 : # G6 . S o l u t i o n s 1 1 1 1 1 1 0 1 1 1 1 1 . D i f f i c u l t b1 = x [ 1 ] b2 = x [ 2 ] b3 = x [ 3 ] b4 = x [ 4 ] b5 = x [ 5 ]
i 1 = D* i +d # c u r r e n t q u b i t o f t h e p o s i t i o n i 2 = n q b i t s =D + d # c u r r e n t q u b i t o f g i f i d 2 = i n f i d N o S v ( i 1 , i 2 , c o u n t s ) v [ i 1 ] = w* v [ i 1 ] + u n i f o r m ( 0 , c 2 ) * i f i d 2 i f a b s ( v [ i 1 ] ) > vMax : p r i n t ( " Warning , v " , v [ i 1 ] ) S . append ( mapping ( v [ i 1 ] ) ) v =
i 1 = D* i +d # c u r r e n t q u b i t o f t h e p o s i t i o n i 2 = n q b i t s =D + d # c u r r e n t q u b i t o f g i f i d 2 =i n f i d N o S v I B M ( i 1 , i 2 , qd , m e a s u r e d ) v [ i 1 ] = w* v [ i 1 ] + u n i f o r m ( 0 , c 2 ) * i f i d 2 i f a b s ( v [ i 1 ] ) > vMax : p r i n t ( " Warning , v " , v [ i 1 ] ) S . append ( mapping ( v [ i 1 ] ) ) v =
i f i d = 1 = s t a t e _ f i d e l i t y ( s v 1 , s v 2 ) # i n [ 0 , 1 ] i f i d = 2 * i f i d =1 # i n [ = 1 , 1 ] i f i d = r o u n d ( i f i d ) # i n { =1 , 0 , 1 } r e t u r n i f i d d e f i n f i d N o S v I B M ( i 1 , i 2 ,
i f i d = 1 = s t a t e _ f i d e l i t y ( s v 1 , s v 2 ) # i n [ 0 , 1 ] i f i d = 2 * i f i d =1 # i n [ = 1 , 1 ] # i f i d = r o u n d ( i f i d ) # i n { =1 , 0 , 1 } r e t u r n i f i d d e f q u b i t S t
IBM = n q b i t s > max_qubits o r IBM i f IBM : p r i n t ( "IBM c l o u d " ) f r o m q i s k i t _ i b m _ r u n t i
p r i n t ( " D i m e n s i o n " , D) p r i n t ( " Swarm s i z e " ,N) p r i n t ( " Number o f q u b i t s " , n q b i t s ) p r i n t ( " Runs " , runMax ) p r i n t ( " I t e r a t i o n s / r u n " , tMax ) p r i n t ( n s h o t s , " s h o t s " ) p r i n t ( " r e s t o r e " , r e s t o r e ) p r i n t ( " T o t a l number o f e v a l u a t i o n s " , FEtot ) p r i n t ( "w , c " ,w , c 2 ) p r i n t ( " B e s t r e s u l t : " ) p r i n t ( x B e s t B e s t , " =>", f M i n B e s t ) p r i n t ( " S u c c e s s r a t e " , s u c c e s s / runMax ) p r i n t ( " S u c c e s s r a t e w i t h random s e a r c h " , 1 / 2 **D) # p r i n t ( " l i s t n " , l i s t n ) l i s t n . remove ( n ) # Not n i t s e l f #p r i n t ( "N, K, n , l i s t n , n " ,N, K, n , l i s t n ) p r i n t ( n s h o t s , " n s h o t s " ) n b i t s = n q b i t s # To s a v e t h e f i t n e s s v a l u e p r i n t ( " n q b i t s " , n q b i t s ) a l l q b i t s = l i s t ( r a n g e ( n q b i t s ) ) p r i n t ("==========================", " I t e r a t i o n " , t ) q = Q u a n t u m R e g i s t e r ( n q b i t s ) c = C l a s s i c a l R e g i s t e r ( m e a s u r e d ) q c = Q u a n t u m C i r c u i t ( q , c ) i f t == 1 : p r i n t ( " A f t e r " , t , " i t e r a t i o n s : " ) p r i n t ( " and " , FEs , " e v a l u a t i o n s " ) p r i n t ( x B e s t , " =>", f M i n ) p r i n t("============================= F i n a l r e s u l t " ) p r i n t ( " F u n c t i o n " , f C o d e ) p r i n t ( " D i m e n s i o n " , D) p r i n t ( " Swarm s i z e " , N) p r i n t ( " N e i g h b o r h o o d s i z e " , K) p r i n t ( " Number o f q u b i t s " , n q b i t s ) p r i n t ( " Runs " , runMax ) p r i n t ( " I t e r a t i o n s / r u n " , tMax ) p r i n t ( n s h o t s , " s h o t s " ) p r i n t ( " T o t a l number o f e v a l u a t i o n s " , FEtot ) p r i n t ( "w , c1 , c 2 " , w , c1 , c 2 ) p r i n t ( " B e s t r e s u l t : " ) p r i n t ( x B e s t B e s t , " =>", f M i n B e s t ) p r i n t ( " S u c c e s s r a t e " , s u c c e s s / runMax ) p r i n t ( " S u c c e s s r a t e w i t h random s e a r c h " , 1 / 2 **D) Below is a Qiskit code to temporarily copy the state of a set of qubits (here two) to another one. It is possible only if the system accepts reset. This feature can be used to apply rules like if f (x) ≤ f (best) then best = x # 2 qubits => 2 qubits example from qiskit import * from qiskit.quantum_info import Statevector # Define a circuit q = QuantumRegister(4) qc = QuantumCircuit(q) qc.h(0) qc.h(1) qc.barrier(q) # For clarity qc.reset([2, 3]) qc.cx(0, 2) qc.cx(1, 3) print(qc) # Note:This visualization is possible # only in a simulation sv = Statevector.from_instruction(qc) sv.draw ('latex') By running this code we generate the circuit of the gure 8.1, and the state vector (visible only in a simulation, not on a real quantum device) is

n e i g h = [ ] f o r _ i n
= i n f i d N o S v ( i 1 , i 3 , c o u n t s ) i f i d 2 = i n f i d N o S v ( i 1 , i 2 , c o u n t s ) v [ i 1 ] = w* v [ i 1 ] + u n i f o r m ( 0 , c 2 ) * i f i d 2 \ + u n i f o r m ( 0 , c 1 ) * i f i d 1 i f a b s ( v [ i 1 ] ) > vMax : p r i n t ( " Warning , v " , v [ i 1 ] ) S . append ( mapping ( v [ i 1 ] ) ) v = np .
= i n f i d N o S v I B M ( i 1 , i 3 , qd , m e a s u r e d ) i f i d 2 = i n f i d N o S v I B M ( i 1 , i 2 , qd , m e a s u r e d ) v [ i 1 ] = w* v [ i 1 ] + u n i f o r m ( 0 , c 2 ) * i f i d 2 \ + u n i f o r m ( 0 , c 1 ) * i f i d 1 i f a b s ( v [ i 1 ] ) > vMax : p r i n t ( " Warning , v " , v [ i 1 ] ) S . append ( mapping ( v [ i 1 ] ) ) v =
1 2 |0000 > + 1 2 |0101 > + 1 2 |1010 > + 1 2 |1111 >
Instead of 16 states we have only 4, because qubits 2 and 3 are always equal to qubits 0 and 1.

Figure 1 . 2 :Figure 2

 122 Figure 1.2: After measure the probability of each bit string is not exactly the theoretical one (0.125)

Figure 2 . 2 :

 22 Figure 2.2: Solving a 6-bits problem by Grover's search. Two solutions.

  Figure 4.1: A simple bimodal function

Figure 4

 4 Figure 4.2: A typical circuit. The rst q-particle (three qubits) is an improvement and copied to save it.

  In 1D representation on integer points it is multimodal. Each local valley contains seven points so it is dicult to escape.

Figure 4 . 3 :

 43 Figure 4.3: Rastrigin landscapes.

Figure 4

 4 Figure 4.4: A typical circuit (N = 2, , K=1,D = 2). At this time step explorer1 (qubits 0 and 1) moves and nds a better position. After, thanks to the saved S values, it is rebuilt and copied to its memory (qubits 4 and 5).

Let2

  So if we want to initialize a qubit in the α β state we just have to reset it to |0 > and then apply R y (2 arccos (α)). The β value is set to sin (arccos (α)).

  something like S = α 1 |01...10 > +α 2 |10...00 > +...α n |001...0 > (6.8) in which each bit string has the same length and with n i=1 |α i | 2 = 1 for each |α i | 2 is a probability. It means that if we measure the state we will nd one (and just one) of the bit string sequences and with the associated probability.

(

  If we have f (x, y) and if x needs n x bits and y needs n y bits then the resulting binary function will be f b 0 , . . . , b nx-1 , b nx , . . . , b nx+ny-1 learn Python and Qiskit (0.44.1 version) to write these codes. I didn't become an expert, but someone skilled could surely make the codes shorter and better. I did tests on a Linux laptop using Anaconda/Jupyter, and the operating system was Ubuntu 22.04. qiskit_optimization.algorithms \ import GroverOptimizer, MinimumEigenOptimizer # Works well only for Quadratic unconstrained binary optimization from qiskit_optimization.translators \ import from_docplex_mp from docplex.mp.model import Model model = Model() # G6 x0 = model.binary_var(name="x0") x1 = model.binary_var(name="x1") x2 = model.binary_var(name="x2") x3 = model.binary_var(name="x3") x4 = model.binary_var(name="x4") x5 = model.binary_var(name="x5") n=6 def c(xa,xb): cv=4-xa -2*xb +xa*xb return cv def fit(x0,x1,x2,x3,x4,x5): f=-(15-c(x0,x1)-c(x1,x2)-c(x2,x3)-c(x3,x4)-c(x4,x5)) return f #-

  -processing res=results.samples lres=len(res) x=list(range(lres)) pr=list(range(lres)) for i in range(lres): pr[i]=res[i].probability s = [str(element) for element in np.int_(res[i].x)] x[i] =.join(s) import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_axes([0,0,1,1]) ax.bar(x,pr) ax.set_ylabel('Probability') ax.set_xlabel('Position') plt.xticks(fontsize=7,rotation = 90) plt.show()

  *b1+4*b2+8*b3 = 3 u2 = b4+2*b5+4*b6+8*b7 = 5 f = 2 0 + u1 *u1=10*math . c o s ( 2 * P i *u1 ) \ + u2 *u2=10*math . c o s ( 2 * P i *u2 ) # J u s t t o d e t e c t p o s s i b l e b i a s random , uniform , sample , randrange , randint , choice from qiskit . quantum_info import DensityMatrix from qiskit import Aer from qiskit . extensions import Initialize def IBM_backends_list (): # List of available backends from qiskit_ibm_runtime import QiskitRuntimeService backends = QiskitRuntimeService (). backends () for i in range ( len ( backends )): print ( backends [ i ])# -

  def initPos ( rank1 , rank2 , qc ): # Init explorer swarm qc . h ( range ( rank1 , rank2 )) def initPos2 ( rank1 , rank2 , qc ): for i in range ( rank1 , rank2 ): theta = uniform (0 ,2* Pi ) qc . ry ( theta , i ) def mostProbable ( counts , tolerance ): values = list ( counts . values ()) keys = list ( counts . keys ()) # With " local " run , the length of the keys # is exactly the number of measured qubits proba = np . array ( values )/ sum ( values ) probaMax = max ( proba ) # Find more or less equivalent ones sList =[] for i in range ( len ( values )): if values [ i ] >= tolerance * probaMax : sList . append ( keys [ i ]) # Random choice string = choice ( sList ) return string , probaMaxdef mostProbableIBM ( qd0 , tolerance , measured ): # Extract from a quasi -distribution # ( coming from the IBM cloud , for example ) proba = list ( qd0 . values ()) # Probabilities keys = list ( qd0 . keys ()) # Bit string ( coded as integer ) ''' proba0 =0 for k in range ( len ( keys )): string = keys [ k ] ind = len ( string ) -i -1 # Because litte -endian notation if string [ ind ]== '0 ': proba0 = proba0 + values [ k ] qDensity = DensityMatrix ([[ proba0 ,0] ,[0 ,1 -proba0 ]]) return qDensity def diagSquare ( M ): diag = np . sqrt ( np . diagonal ( M )) return diag def assignProba0 ( qc ,i , dm , p ): # dm = density matrix of a qubit # p = desired probability for |0 > # Just a bit of algebra p0 = np . array ( dm )[0][0] # Initial probability A = math . sqrt ( p0 * p ) B = math . sqrt ( max ( p0 * p -p -p0 +1 ,0)) # It may be slightly <0 # Because numerical instability x1 = max ( min ( A +B ,1) , -1) x2 = max ( min (A -B ,1) , -1) theta1 =2* math . acos ( x1 ) theta2 =2* math . acos ( x2 ) theta = min ( theta1 , theta2 ) # Then you have to apply Ry ( theta , i ) qc . ry ( theta , i +100 # Should be +1 , but faster pt = probaEach (m , n ) # To cope with the numerical instability # Warning : may induce infinite loop # or incorrect results if m is too big if pt <0 or pt >1: range ( m +1): comb = combin (m , i ) # print (" comb " , comb ) p = p +(( -1)** i ) * comb * (( i / m )** nd ) # print (" p " , p u s r / b i n / e n v p y t h o n # c o d i n g : u t f =8 # I n [ ] : i m p o r t numpy a s np i m p o r t math P i = math . p i f r o m random i m p o r t random , u n i f o r m , s a m p l e , r a n d r a n g e , r a n d i n t , c h o i c e f r o m q i s k i t . qu a nt u m_ in f o i m p o r t s t a t e _ f i d e l i t y d e f i n i t V e l (N, D, vMax ) : # (N, D, vMax ) : # ' V e l o c i t y ' i n i t i a l i s a t i o n v = [ ] f o r _ i n r a n g e (N*D ) : v . append ( u n i f o r m (=vMax , vMax ) ) r e t u r n v d e f u p d a t e V e l N o S v (N, D, n q b i t s , v , c o u n t s , w , c2 , vMax ) : # V e l o c i t y u p d a t e S = [ ] f o r i i n r a n g e (N ) : f o r d i n r a n g e (D ) :

  np . a r r a y ( v ) S = np . a r r a y ( S ) r e t u r n v , S d e f updateVelNoSvIBM (N, D, n q b i t s , v , qd , w , c2 , vMax , m e a s u r e d ) : # V e l o c i t y u p d a

  np . a r r a y ( v ) c x ( r a n k 1+d , r a n k 2+d ) d e f u p d a t e P o s ( S , N, D, q c ) : # ' P o s i t i o n ' u p d a t e f o r i i n r a n g e (N ) : f o r d i n r a n g e (D ) : j = D* i +d q c . r y ( P i *S [ j ] , j ) d e f d i s p C i r c u i t ( q c ) : qcDec = q c . d e c o m p o s e ( ) . d e c o m p o s e ( ) . d e c o m p o s e ( ) . d e c o m p o s e ( ) #qcDec . draw ( ) p r i n t ( qcDec ) d e f i n f i d N o S v ( i 1 , i 2 , c o u n t s ) : s v 1=q u b i t S t a t e C o u n t s ( c o u n t s , i 1 ) s v 2=q u b i t S t a t e C o u n t s ( c o u n t s , i 2 )

  qd , m e a s u r e d ) : s v 1=q u b i t S t a t e C o u n t s I B M ( qd , i 1 , m e a s u r e d ) s v 2=q u b i t S t a t e C o u n t s I B M ( qd , i 2 , m e a s u r e d )

  a t e C o u n t s I B M ( qd0 , i , m e a s u r e d ) : k e y s= l i s t ( qd0 . k e y s ( ) ) v a l u e s= l i s t ( qd0 . v a l u e s ( ) ) # For q u b i t i , p r o b a b i l i t y t o be 0 p r o b a 0=0 f o r k i n r a n g e ( l e n ( k e y s ) ) : s t r i n g = f o r m a t ( k e y s [ k ] , ' b ' ) l s =l e n ( s t r i n g ) i f l s <m e a s u r e d : # C o m p l e t e w i t h l e a d i n g z e r o s s t r i n g = s t r i n g . z f i l l ( m e a s u r e d ) i n d=l e n ( s t r i n g )= i =1 # B e c a u s e l i t t e =e n d i a n n o t a t i o n i f s t r i n g [ i n d ] = = ' 0 ' : p r o b a 0=p r o b a 0+v a l u e s [ k ] p =[ math . s q r t ( p r o b a 0 ) , math . s q r t (1= p r o b a 0 ) ] r e t u r n p d e f q u b i t S t a t e C o u n t s ( c o u n t s , i ) : k e y s= l i s t ( c o u n t s . k e y s ( ) ) v a l u e s=np . a r r a y ( l i s t ( c o u n t s . v a l u e s ( ) ) ) v a l u e s=v a l u e s /sum ( v a l u e s ) # For q u b i t i , p r o b a b i l i t y t o be 0 p r o b a 0=0 f o r k i n r a n g e ( l e n ( k e y s ) ) : s t r i n g = k e y s [ k ] i n d=l e n ( s t r i n g )= i =1 # B e c a u s e l i t t e =e n d i a n n o t a t i o n #i n d= i i f s t r i n g [ i n d ] = = ' 0 ' : p r o b a 0=p r o b a 0+v a l u e s [ k ] p =[ math . s q r t ( p r o b a 0 ) , math . s q r t (1= p r o b a 0 r i d Quantum PSO f o r b i n a r y p r o b l e m s by M a u r i c e . C l e r c @>WriteMe . com L a s t u p d a t e : 2024 =01=13 T h i s v e r s i o n d o e s n o t u s e t h e s t a t e v e c t o r , s o i t i s more s u i t a b l e f o r a r e a l quantum d e v i c e J u s t f o r a p r o o f o f c o n c e p t : = g l o b a l b e s t t o p o l o g y = m i m i c k i n g t h e c l a s s i c a l b i n a r y PSO May n e e d ( L i n u x ) e c h o 1 | s u d o t e e / p r o c / s y s /vm/ overcommit_memory ' ' ' f r o m T o o l s 2 i m p o r t * f r o m T o o l s 1 i m p o r t * f r o m F u n c t i o n s i m p o r t * np . s e t _ p r i n t o p t i o n s ( p r e c i s i o n =3) f r o m q i s k i t . qu a nt u m_ in f o i m p o r t s t a t e _ f i d e l i t y # ====================================================== max_qubits = 17 # The max f o r my c o m p u t e r IBM = F a l s e # Note : i t w i l l b e f o r c e d t o True # i f more q u b i t s t h a n max_qubits f C o d e = 8 # *** H e r e c h o o s e t h e f u n c t i o n runMax = 1 0 0 tMax = 4 # Number o f i t e r a t i o n s f o r e a c h r u n # You may s e t i t t o I n f b u t # WARNING: p o s s i b l e i n f i n i t e l o o p v e r b o s e=F a l s e p l o t C i r c u i t=F a l s e r e s t o r e =F a l s e # J u s t f o r t e

  m e a s u r e d = N*D #n q b i t s m e a s u r e d Q b i t s= l i s t ( r a n g e (N*D) ) i f v e r b o s e : p r i n t ( " F u n c t i o n " , f C o d e ) p r i n t ( " D i m e n s i o n " , D)

  m e i m p o r t S a m p l e r , S e s s i o n , Q i s k i t R u n t i m e S e r v i c e f r o m q i s k i t _ i b m _ r u n t i m e i m p o r t E s t i m a t o r s e r v i c e = Q i s k i t R u n t i m e S e r v i c e ( c h a n n e l ="ibm_quantum " ) b a c k e n d = s e r v i c e . b a c k e n d ( " ibmq_qasm_simulator " ) e l s e : b a c k e n d = Aer . g e t _ b a c k e n d ( ' s t a t e v e c t o r _ s i m u l a t o r ' )

  (N, D, n q b i t s , v , qd , w , c2 , vMax , m e a s u r e d ) e l s e : v , S=u p d a t e V e l N o S v (N, D, n q b i t s , v , c o u n t s , w , c2 , vMax ) u p d a t e P o s ( S , N, D, q c ) q c . m e a s u r e ( m e a s u r e d Q b i t s , m e a s u r e d Q b i t s ) i f p l o t C i r c u i t : q c . b a r r i e r ( r a n g e ( n q b i t s ) ) # J u s t t o b e t t e r s e e t h e c i r c u i t d i s p C i r c u i t ( q c ) # =========== i f IBM : w i t h S e s s i o n ( b a c k e n d=b a c k e n d ) : s a m p l e r = S a m p l e r ( ) r e s u l t = s a m p l e r . r u n ( qc , s h o t s=n s h o t s ) . r e s u l t ( ) qd = r e s u l t . q u a s i _ d i s t s [ 0 ] b i t s t r i n g , p r o b a = mostProbableIBM ( qd , t o l e r a n c e , m e a s u r e d ) e l s e : j o b = e x e c u t e ( qc , b a c k e n d , s h o t s=n s h o t s ) r e s u l t = j o b . r e s u l t ( ) c o u n t s = r e s u l t . g e t _ c o u n t s ( q c ) b i t s t r i n g , p r o b a = m o s t P r o b a b l e ( c o u n t s , t o l e r a n c e ) i f v e r b o s e : p r i n t ( " Most p r o b a b l e " , b i t s t r i n g , " p r o b a : " , p r o b a ) # For e a c h q= p a r t i c l e # e v a l u a t e i t s f i t n e s s and com par e f o r n i n r a n g e (N ) : # r a n g e (N) ? ? N=1 ? ? x = np . z e r o s (D, d t y p e=i n t ) l s = l e n ( b i t s t r i n g ) f o r d i n r a n g e (D ) : # ( l i t t l e =e n d i a n n o t a t i o n ) x [ d ] = i n t ( b i t s t r i n g [ l s =d=1 = n *o b a l b e s t p o s i t i o n i f v e r b o s e : p r i n t ( " Improvement . x B e s t =" , x B e s t , fMin , "=>", f ) f M i n = f c o p y P o s ( n , i B e s t , qc , D) # To g l o b a l b e s t q= p a r t i c l e g i f f M i n < f M i n B e s t : f M i n B e s t = f M i n x B e s t B e s t = x B e s t s t o p = t >= tMax o r f M i n <= minimum i f t >= tMax : p r i n t ( "STOP t >=", tMax ) i f f M i n <= minimum : p r i n t ( "STOP f B e s t <=", minimum ) s u c c e s s=s u c c e s s +1 F E s u c c e s s . append ( FEs ) i f p l o t C i r c u i t : d i s p C i r c u i t ( q c )

  n t ( " Mean number o f e v a l u a t i o n s f o r s u c c e s s f u l r u n s : " ,mFE ) r i d Quantum PSO f o r b i n a r y p r o b l e m s by M a u r i c e . C l e r c @>WriteMe . com L a s t u p d a t e : 2024 =01=15 J u s t f o r a p r o o f o f c o n c e p t : = l o c a l b e s t t o p o l o g y = m i m i c k i n g t h e c l a s s i c a l b i n a r y PSO May n e e d ( L i n u x ) e c h o 1 | s u d o t e e / p r o c / s y s /vm/ overcommit_memory ' ' ' f r o m q i s k i t . qu a nt u m_ in f o i m p o r t s t a t e _ f i d e l i t y f r o m F u n c t i o n s i m p o r t * f r o m T o o l s 1 i m p o r t * f r o m T o o l s 2 i m p o r t * d e f n e i g h b o u r (N, K, n ) : # N e i g h b o u r s o f n . Random t o p o l o g y OK = F a l s e l i s t n = l i s t ( r a n g e ( 0 , N) )

  u p d a t e V e l (N, K, D, n q b i t s , v , c o u n t s , w , c1 , c2 , vMax , f P r e v ) : # V e l o c i t y u p d a t e S = [ ] f o r i i n r a n g e (N ) : # F i n d t h e l o c a l b e s t n e i g h = n e i g h b o u r (N, K, i ) fPrev_n = [ f P r e v [ i ] f o r i i n n e i g h ] p_rank = n e i g h [ np . a r r a y ( fPrev_n ) . argmax ( ) ] f o r d i n r a n g e (D ) : i 1 = D* i +d # c u r r e n t q u b i t o f t h e p o s i t i o n i 2 = p_rank *D+d # l o c a l b e s t i 3 = N*D+ i *D+d # p r e v i o u s b e s t i f i d 1

  updateVelIBM (N, K, D, n q b i t s , v , qd , w , c1 , c2 , vMax , f P r e v , m e a s u r e ) : # V e l o c i t y u p d a t e S = [ ] f o r i i n r a n g e (N ) : # F i n d t h e l o c a l b e s t n e i g h = n e i g h b o u r (N, K, i ) fPrev_n = [ f P r e v [ i ] f o r i i n n e i g h ] p_rank = n e i g h [ np . a r r a y ( fPrev_n ) . argmax ( ) ] f o r d i n r a n g e (D ) : i 1 = D* i +d # c u r r e n t q u b i t o f t h e p o s i t i o n i 2 = p_rank *D+d # l o c a l b e s t i 3 = N*D+ i *D+d # p r e v i o u s b e s t i f i d 1

  np . a r r a y ( v ) S = np . a r r a y ( S ) f i t e r a t i o n s f o r e a c h r u n # You may s e t i t t o I n f b u t # WARNING: p o s s i b l e i n f i n i t e l o o p v e r b o s e = F a l s e p l o t C i r c u i t = F a l

  s u r e d Q b i t s = l i s t ( r a n g e (N*D) ) i f v e r b o s e : p r i n t ( " F u n c t i o n " , f C o d e )p r i n t ( " D i m e n s i o n " , D) p r i n t ( n q b i t s , " q u b i t s " ) IBM = n q b i t s > max_qubits o r IBM i f IBM :p r i n t ( "IBM c l o u d " ) f r o m q i s k i t _ i b m _ r u n t i m e i m p o r t S a m p l e r , S e s s i o n , Q i s k i t R u n t i m e S e r v i c e , E s t i m f r o m q i s k i t _ i b m _ r u n t i m e i m p o r t E s t i m a t o r s e r v i c e = Q i s k i t R u n t i m e S er v i c e ( c h a n n e l ="ibm_quantum " ) b a c k e n d = s e r v i c e . b a c k e n d ( " ibmq_qasm_simulator " ) e l s e : b a c k e n d = Aer . g e t _ b a c k e n d ( ' s t a t e v e c t o r _ s i m u l a t o r ' ) # ============================================================= Runs f M i n B e s t = I n f # F i n a l b e s t v a l u e o v e r a l l r u n s FEtot = 0 # T o t a l number o f e v a l u a t i o n e v = I n f *np . o n e s (N) #p l u s M i n u s = [ 1 , =1] f L i s t = [ ] # J u s t f o r i n f o r m a t i o n s t o p = F a l s e w h i l e n o t s t o p : t = t +1 i f v e r b o s e :

F

  updateVelIBM (N, K, D, n q b i t s , v , qd , w , c1 , c2 , vMax , f P r e v , m e a s u r e d ) e l s e : v , S = u p d a t e V e l (N, K, D, n q b i t s , v , c o u n t s , w , c1 , c2 , vMax , f P r e v ) u p d a t e P o s ( S , N, D, q c ) q c . m e a s u r e ( m e a s u r e d Q b i t s , m e a s u r e d Q b i t s ) i f p l o t C i r c u i t : q c . b a r r i e r ( r a n g e ( n q b i t s ) ) # J u s t t o b e t t e r s e e t h e c i r c u i td i s p C i r c u i t ( q c ) # =========== i f IBM : w i t h S es s i o n ( b a c k e n d=b a c k e n d ) : s a m p l e r = S a m p l e r ( ) r e s u l t = s a m p l e r . r u n ( qc , s h o t s=n s h o t s ) . r e s u l t ( ) qd = r e s u l t . q u a s i _ d i s t s [ 0 ] b i t s t r i n g , p r o b a = mostProbableIBM ( qd , t o l e r a n c e , m e a s u r e d ) e l s e : j o b = e x e c u t e ( qc , b a c k e n d , s h o t s=n s h o t s ) r e s u l t = j o b . r e s u l t ( ) c o u n t s = r e s u l t . g e t _ c o u n t s ( q c ) b i t s t r i n g , p r o b a = m o s t P r o b a b l e ( c o u n t s , t o l e r a n c e ) i f v e r b o s e : p r i n t ( " Most p r o b a b l e " , b i t s t r i n g , " p r o b a : " , p r o b a ) # For e a c h q= p a r t i c l e # e v a l u a t e i t s f i t n e s s and com par e f o r n i n r a n g e (N ) : x = np . z e r o s (D, d t y p e=i n t ) #l s = l e n ( b i t s t r i n g ) f o r d i n r a n g e (D ) : # ( l i t t l e =e n d i a n n o t a t i o n ) x [ d ] = i n t ( b i t s t r i n g [ D=d=1 = n *n t ( " Improvement . x B e s t =" , x B e s t , fMin , "=>", f ) f M i n = f # c o p y P o s ( n , i B e s t , qc , D) # To g l o b a l b e s t q= p a r t i c l e g i f f M i n < f M i n B e s t : f M i n B e s t = f M i n x B e s t B e s t = x B e s t s t o p = t >= tMax o r f M i n <= minimum i f t >= tMax : p r i n t ( "STOP t >=", tMax ) i f f M i n <= minimum : p r i n t ( "STOP f B e s t <=", minimum ) s u c c e s s = s u c c e s s +1

  Figure 8.1: Copying qubits. 2 ⇒ 2 example

  Note that if you consider bits as logical values you can replace 1 -x i,t,d by ¬x i,t,d (i.e. switching the bit).

	3 In	the	original	paper	the	formula	is	wrongly	noted
	x i,(t+1),d = 1 if U (0, 1) < S v i,(t+1),d
			0 else

Table 1 :

 1 equal to 1. Then the Ry rotation switches the qubit, as in the non-quantum approach (formula 3.2). But here the process is smoother for smaller S values: only the probabilities of |0 > and |1 > are modied. How a qubit goes towards another thanks to R y rotations. Note the We can estimate what could be the maximum value for v i,d . The worst-case scenario occurs repeatedly when the delities are zero and the random ci,d equal to c. At the limit, as w < 1 we nd

	Example We have x i,d = for which the qubit d is √ 0.2×|0 > + √ 0.9 × |0 > + √ 0.8×|1 > and a better position has been found √ 0.1 × |1 >. So the qubit x i,d should go
	towards this one. Assuming there is no more improvement for eight iterations,
	a possible evolution of x i,d is given in Table 1. As expected the probability of
	state |0> (and, of course also the one of |1>) rst tends to the good one (0.9)
	and then oscillates.

Table 2 :

 2 Global best HQPSO -Sin3 problem -100 runs. The success rate of

	random search would be 12.5 %.
	Swarm size	1	1	2	2	3
	Qubits	6	6	9	9	12
	Shots	500	500	1024	1024	1024
	Iterations/run	4	10	4	10	4
	Evaluations	396	1089	382	804	327
	Success rate	66 %	92 %	88 %	99 %	98 %

Table 3 :

 3 Global best HQPSO -G6 problem -100 runs. The success rate of random search would be 3.125 %.

	Swarm size	1	1	2	2	3
	Qubits	12	12	18	18	24
	Shots	2048	2048	2048	2048	2048
	Iterations/run	4	10	4	10	4
	Evaluations	493	2131	468	904	597
	Success rate	31 %	81 %	84 %	100 %	91 %

Table 4 :

 4 Global best HQPSO -Binary Rastrigin problem on [0, 7] 2 -100 runs.The success rate of random search would be 1.56 %.

	Swarm size	1	1	2	2	2	3	3
	Qubits	12	12	18	18	18	24	24
	Shots	1024	1024	1024	2048	2048	1024	2048
	Iterations/run	4	10	4	4	10	4	4
	Evaluations	555	3959	1138	1096	7950	1617	1611
	Success rate	10 %	16 %	11 %	13 %	14 %	16 %	15 %

(a) Continuous. Highly multimodal. (b) On integer 2D points it is unimodal but our HQPSO doesn't see that.

Table 5 :

 5 Local best HQPSO -Some results

			Sin3	Sin3	G6	G6	G6	Rastrigin	Rastrigin
		Swarm size	2	2	2	2	3	2	2
	Neighborhood size	1	1	1	1	2	1	1
		Qubits	24	24	24	24	36	24	24
		Shots	1024	1024	1024	1024	2048	2048	2048
	Iterations/run	4	10	4	10	4	4	10
		Evaluations	594	2440	1046	6936	5904	1112	7798
		Success rate	70 %	89 %	21 %	28 %	24 %	10 %	15 %
	4.3	Local best topology

We can try with a local best topology, a random variable one with at most K neighbors (like say in SPSO 2007, available on the Particle Swarm Central PSC 2024). The velocity update formula is now the complete one 4.1.

These values comes from the classical Standard PSO but nothing proves this is a good choice here.

On the IBM cloud the length of the key as bit string may need leading zeros so that the string has the right length ( i . e .) the number of measured qubits . # For qubit i , probability to be 0