<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Quantum Molecular Computing</title>
<link>https://nicdeclic.com/</link>
<atom:link href="https://nicdeclic.com/index.xml" rel="self" type="application/rss+xml"/>
<description>Open Research Notes &amp; Dynamic Notebooks</description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Fri, 11 Sep 2026 04:00:00 GMT</lastBuildDate>
<item>
  <title>Welcome To A Whole New Space to Explore!</title>
  <dc:creator>NicDeclic </dc:creator>
  <link>https://nicdeclic.com/posts/welcome/</link>
  <description><![CDATA[ 





<p><img src="https://nicdeclic.com/images/splash.jpg" class="img-fluid"></p>
<p>test</p>
<div id="07e11f62" class="cell" data-execution_count="1">
<details class="code-fold">
<summary>Click to see the code imports</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> qiskit <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> QuantumCircuit</span>
<span id="cb1-2"></span>
<span id="cb1-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> schemdraw</span>
<span id="cb1-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> schemdraw.logic <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> logic</span>
<span id="cb1-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> schemdraw.elements <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> elm</span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> rdkit <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Chem</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> rdkit.Chem <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Draw</span>
<span id="cb1-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> rdkit.Chem.Draw <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> rdMolDraw2D</span>
<span id="cb1-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> SVG</span></code></pre></div></div>
</details>
</div>
<p>This is the first post in a Quarto blog. Welcome!</p>
<div id="cell-fig-bell-state" class="cell" data-message="false" data-execution_count="2">
<details class="code-fold">
<summary>Click to see the Qiskit circuit setup code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Vous créez votre circuit</span></span>
<span id="cb2-2">qc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QuantumCircuit(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb2-3">qc.h(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Porte de Hadamard</span></span>
<span id="cb2-4">qc.cx(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Porte CNOT (intrication)</span></span>
<span id="cb2-5">qc.measure_all()</span>
<span id="cb2-6"></span>
<span id="cb2-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Vous affichez le circuit avec un rendu pro</span></span>
<span id="cb2-8">qc.draw(output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mpl'</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 'mpl' utilise Matplotlib pour un dessin haute résolution</span></span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display" data-execution_count="2">
<div id="fig-bell-state" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-bell-state-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://nicdeclic.com/posts/welcome/index_files/figure-html/fig-bell-state-output-1.png" width="448" height="229" class="figure-img">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-bell-state-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Quantum circuit for Bell State generation.
</figcaption>
</figure>
</div>
</div>
</div>
<div id="51af3374" class="cell" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Création du dessin</span></span>
<span id="cb3-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> schemdraw.Drawing() <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> d:</span>
<span id="cb3-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Porte logique standard (AND)</span></span>
<span id="cb3-4">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(logic.And())</span>
<span id="cb3-5">    </span>
<span id="cb3-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Porte NOT connectée à la sortie de la porte AND</span></span>
<span id="cb3-7">    d.add(logic.Not().at(A.out))</span>
<span id="cb3-8">    </span>
<span id="cb3-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Une ligne vers la droite</span></span>
<span id="cb3-10">    L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(elm.Line().right().length(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'State |ψ⟩'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'top'</span>))</span>
<span id="cb3-11">    </span>
<span id="cb3-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. Pour un cercle customisé, on utilise elm.Dot ou les formes 'shapes' :</span></span>
<span id="cb3-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Solution A : Un grand point / nœud coloré (très simple)</span></span>
<span id="cb3-14">    d.add(elm.Dot(radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>).at(L.end).color(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lightblue'</span>).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Molecule</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Node'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center'</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>))</span>
<span id="cb3-15">    </span>
<span id="cb3-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Solution B : Pour faire vos propres boîtes "boîte noire" quantique :</span></span>
<span id="cb3-17">    d.add(elm.Line().right().length(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>))</span>
<span id="cb3-18">    d.add(elm.Ic(pins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[elm.IcPin(name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'In'</span>, side<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'left'</span>), </span>
<span id="cb3-19">                       elm.IcPin(name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Out'</span>, side<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>)],</span>
<span id="cb3-20">                 size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Custom</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Gate'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center'</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://nicdeclic.com/posts/welcome/index_files/figure-html/cell-4-output-1.svg" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div class="cell" data-layout-align="default">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<pre class="mermaid mermaid-js">flowchart LR
    A["Initial State |0⟩"] --&gt; B["Molecular Hamiltonian"]
    B --&gt; C{"VQE Optimization"}
    C --&gt;|Update parameters| B
    C --&gt;|Converged| D["Ground State Energy"]
</pre>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<div class="cell" data-layout-align="default">
<div class="cell-output-display">
<div>
<p></p><figure class="figure"><p></p>
<div>
<svg width="672" height="480" viewbox="0.00 0.00 370.99 246.71" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" style="; max-width: none; max-height: none">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 242.71)">
<title>G</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-242.71 366.99,-242.71 366.99,4 -4,4"></polygon>
<!-- run -->
<g id="node1" class="node">
<title>run</title>
<ellipse fill="none" stroke="black" cx="105.22" cy="-110.03" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="105.22" y="-105.83" font-family="Times,serif" font-size="14.00">run</text>
</g>
<!-- intr -->
<g id="node2" class="node">
<title>intr</title>
<ellipse fill="none" stroke="black" cx="48.11" cy="-59.71" rx="27" ry="18"></ellipse>
<text text-anchor="middle" x="48.11" y="-55.51" font-family="Times,serif" font-size="14.00">intr</text>
</g>
<!-- run&#45;&#45;intr -->
<g id="edge1" class="edge">
<title>run--intr</title>
<path fill="none" stroke="black" d="M88.7,-95.48C81.19,-88.86 72.32,-81.04 64.79,-74.4"></path>
</g>
<!-- kernel -->
<g id="node4" class="node">
<title>kernel</title>
<ellipse fill="none" stroke="black" cx="180.95" cy="-137.54" rx="35.33" ry="18"></ellipse>
<text text-anchor="middle" x="180.95" y="-133.34" font-family="Times,serif" font-size="14.00">kernel</text>
</g>
<!-- run&#45;&#45;kernel -->
<g id="edge4" class="edge">
<title>run--kernel</title>
<path fill="none" stroke="black" d="M129.18,-118.73C136.46,-121.38 144.54,-124.31 152.1,-127.06"></path>
</g>
<!-- runbl -->
<g id="node3" class="node">
<title>runbl</title>
<ellipse fill="none" stroke="black" cx="31.42" cy="-126.16" rx="31.34" ry="18"></ellipse>
<text text-anchor="middle" x="31.42" y="-121.96" font-family="Times,serif" font-size="14.00">runbl</text>
</g>
<!-- intr&#45;&#45;runbl -->
<g id="edge2" class="edge">
<title>intr--runbl</title>
<path fill="none" stroke="black" d="M43.64,-77.51C41.25,-87.05 38.3,-98.76 35.91,-108.3"></path>
</g>
<!-- runbl&#45;&#45;run -->
<g id="edge3" class="edge">
<title>runbl--run</title>
<path fill="none" stroke="black" d="M61.01,-119.7C67.11,-118.36 73.48,-116.97 79.43,-115.67"></path>
</g>
<!-- zombie -->
<g id="node5" class="node">
<title>zombie</title>
<ellipse fill="none" stroke="black" cx="168.31" cy="-220.71" rx="39.42" ry="18"></ellipse>
<text text-anchor="middle" x="168.31" y="-216.51" font-family="Times,serif" font-size="14.00">zombie</text>
</g>
<!-- kernel&#45;&#45;zombie -->
<g id="edge5" class="edge">
<title>kernel--zombie</title>
<path fill="none" stroke="black" d="M178.21,-155.58C176.09,-169.54 173.17,-188.76 171.05,-202.7"></path>
</g>
<!-- sleep -->
<g id="node6" class="node">
<title>sleep</title>
<ellipse fill="none" stroke="black" cx="253.25" cy="-154.97" rx="30.76" ry="18"></ellipse>
<text text-anchor="middle" x="253.25" y="-150.77" font-family="Times,serif" font-size="14.00">sleep</text>
</g>
<!-- kernel&#45;&#45;sleep -->
<g id="edge6" class="edge">
<title>kernel--sleep</title>
<path fill="none" stroke="black" d="M212.87,-145.23C216.81,-146.18 220.81,-147.15 224.69,-148.08"></path>
</g>
<!-- runmem -->
<g id="node7" class="node">
<title>runmem</title>
<ellipse fill="none" stroke="black" cx="240.17" cy="-83.36" rx="43.44" ry="18"></ellipse>
<text text-anchor="middle" x="240.17" y="-79.16" font-family="Times,serif" font-size="14.00">runmem</text>
</g>
<!-- kernel&#45;&#45;runmem -->
<g id="edge7" class="edge">
<title>kernel--runmem</title>
<path fill="none" stroke="black" d="M198.4,-121.57C205.9,-114.71 214.67,-106.69 222.23,-99.77"></path>
</g>
<!-- sleep&#45;&#45;runmem -->
<g id="edge13" class="edge">
<title>sleep--runmem</title>
<path fill="none" stroke="black" d="M249.95,-136.9C247.98,-126.13 245.49,-112.49 243.51,-101.67"></path>
</g>
<!-- swap -->
<g id="node8" class="node">
<title>swap</title>
<ellipse fill="none" stroke="black" cx="330.95" cy="-148.25" rx="30.77" ry="18"></ellipse>
<text text-anchor="middle" x="330.95" y="-144.05" font-family="Times,serif" font-size="14.00">swap</text>
</g>
<!-- sleep&#45;&#45;swap -->
<g id="edge8" class="edge">
<title>sleep--swap</title>
<path fill="none" stroke="black" d="M283.96,-152.31C289.3,-151.85 294.86,-151.37 300.21,-150.91"></path>
</g>
<!-- runswap -->
<g id="node9" class="node">
<title>runswap</title>
<ellipse fill="none" stroke="black" cx="319.23" cy="-73.46" rx="43.51" ry="18"></ellipse>
<text text-anchor="middle" x="319.23" y="-69.26" font-family="Times,serif" font-size="14.00">runswap</text>
</g>
<!-- swap&#45;&#45;runswap -->
<g id="edge9" class="edge">
<title>swap--runswap</title>
<path fill="none" stroke="black" d="M328.11,-130.15C326.28,-118.47 323.91,-103.35 322.08,-91.66"></path>
</g>
<!-- runswap&#45;&#45;runmem -->
<g id="edge11" class="edge">
<title>runswap--runmem</title>
<path fill="none" stroke="black" d="M276.92,-78.76C276.78,-78.77 276.63,-78.79 276.48,-78.81"></path>
</g>
<!-- new -->
<g id="node10" class="node">
<title>new</title>
<ellipse fill="none" stroke="black" cx="278.31" cy="-18" rx="27.25" ry="18"></ellipse>
<text text-anchor="middle" x="278.31" y="-13.8" font-family="Times,serif" font-size="14.00">new</text>
</g>
<!-- runswap&#45;&#45;new -->
<g id="edge10" class="edge">
<title>runswap--new</title>
<path fill="none" stroke="black" d="M306.51,-56.21C301.35,-49.22 295.42,-41.18 290.33,-34.29"></path>
</g>
<!-- new&#45;&#45;runmem -->
<g id="edge12" class="edge">
<title>new--runmem</title>
<path fill="none" stroke="black" d="M268.49,-34.83C263.01,-44.21 256.2,-55.89 250.62,-65.44"></path>
</g>
</g>
</svg>
</div>
<p></p></figure><p></p>
</div>
</div>
</div>
<div id="728424ea" class="cell" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Définir la molécule à partir de sa chaîne SMILES</span></span>
<span id="cb4-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Exemple : La caféine</span></span>
<span id="cb4-3">caffeine_smiles <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CN1C=NC2=C1C(=O)N(C(=O)N2C)C"</span></span>
<span id="cb4-4">mol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chem.MolFromSmiles(caffeine_smiles)</span>
<span id="cb4-5"></span>
<span id="cb4-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Préparer un dessin vectoriel haute définition (SVG)</span></span>
<span id="cb4-7">drawer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rdMolDraw2D.MolDraw2DSVG(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">450</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Largeur, Hauteur</span></span>
<span id="cb4-8"></span>
<span id="cb4-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Options d'esthétique scientifique</span></span>
<span id="cb4-10">options <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> drawer.drawOptions()</span>
<span id="cb4-11">options.addAtomIndices <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Affiche le numéro de chaque atome (très utile pour référencer vos qubits !)</span></span>
<span id="cb4-12">options.bondLineWidth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Épaisseur des liaisons chimiques</span></span>
<span id="cb4-13"></span>
<span id="cb4-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Mettre en évidence des atomes spécifiques </span></span>
<span id="cb4-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Imaginons que les atomes 4, 5 et 6 forment le sous-système quantique que vous étudiez :</span></span>
<span id="cb4-16">target_atoms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]</span>
<span id="cb4-17">target_bonds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [mol.GetBondBetweenAtoms(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>).GetIdx(), mol.GetBondBetweenAtoms(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>).GetIdx()]</span>
<span id="cb4-18"></span>
<span id="cb4-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Dessiner la molécule avec surlignage</span></span>
<span id="cb4-20">drawer.DrawMolecule(</span>
<span id="cb4-21">    mol, </span>
<span id="cb4-22">    highlightAtoms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>target_atoms, </span>
<span id="cb4-23">    highlightBonds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>target_bonds,</span>
<span id="cb4-24">    highlightAtomColors<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)} <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bleu clair</span></span>
<span id="cb4-25">)</span>
<span id="cb4-26">drawer.FinishDrawing()</span>
<span id="cb4-27"></span>
<span id="cb4-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. Afficher directement dans Quarto</span></span>
<span id="cb4-29">svg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> drawer.GetDrawingText()</span>
<span id="cb4-30">SVG(svg)</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="4">
<div>
<figure class="figure">
<p><img src="https://nicdeclic.com/posts/welcome/index_files/figure-html/cell-5-output-1.svg" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="5022a6d0" class="cell" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Initialiser le dessin vectoriel</span></span>
<span id="cb5-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> schemdraw.Drawing() <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> d:</span>
<span id="cb5-3">    d.config(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)</span>
<span id="cb5-4"></span>
<span id="cb5-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Ajouter la porte XOR (Somme)</span></span>
<span id="cb5-6">    xor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(logic.Xor().label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sum ($S$)'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>))</span>
<span id="cb5-7">    </span>
<span id="cb5-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Entrées A et B</span></span>
<span id="cb5-9">    line_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(elm.Line().left(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).at(xor.in1).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'left'</span>))</span>
<span id="cb5-10">    line_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(elm.Line().left(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).at(xor.in2).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'B'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'left'</span>))</span>
<span id="cb5-11"></span>
<span id="cb5-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Ajouter la porte AND (Retenue / Carry) en dessous</span></span>
<span id="cb5-13">    d.add(elm.Line().down(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).at(xor.in1))</span>
<span id="cb5-14">    d.add(elm.Dot()) <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Point de connexion (jonction)</span></span>
<span id="cb5-15">    </span>
<span id="cb5-16">    and_gate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.add(logic.And().at((xor.in1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, xor.in1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)).label(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Carry ($C$)'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>))</span>
<span id="cb5-17">    </span>
<span id="cb5-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Connexions vers la porte AND</span></span>
<span id="cb5-19">    d.add(elm.Wire(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|-'</span>).to(and_gate.in1))</span>
<span id="cb5-20">    d.add(elm.Line().down(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>).at(xor.in2))</span>
<span id="cb5-21">    d.add(elm.Dot())</span>
<span id="cb5-22">    d.add(elm.Wire(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|-'</span>).to(and_gate.in2))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://nicdeclic.com/posts/welcome/index_files/figure-html/cell-6-output-1.svg" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>



 ]]></description>
  <category>news</category>
  <guid>https://nicdeclic.com/posts/welcome/</guid>
  <pubDate>Fri, 11 Sep 2026 04:00:00 GMT</pubDate>
  <media:content url="https://nicdeclic.com/images/splash.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Post With Code</title>
  <dc:creator>Harlow Malloc</dc:creator>
  <link>https://nicdeclic.com/posts/post-with-code/</link>
  <description><![CDATA[ 





<p>This is a post with executable code.</p>



 ]]></description>
  <category>news</category>
  <category>code</category>
  <category>analysis</category>
  <guid>https://nicdeclic.com/posts/post-with-code/</guid>
  <pubDate>Thu, 10 Sep 2026 04:00:00 GMT</pubDate>
  <media:content url="https://nicdeclic.com/posts/post-with-code/image.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
