<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/quantum-computing">
  <channel>
    <title>Quantum Computing</title>
    <link>https://www.linuxjournal.com/tag/quantum-computing</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Taking Python to the Next Level</title>
  <link>https://www.linuxjournal.com/content/taking-python-next-level</link>
  <description>  &lt;div data-history-node-id="1339681" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/bigstock--193598503.jpg" width="300" height="225" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/joey-bernard" lang="" about="https://www.linuxjournal.com/users/joey-bernard" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Joey Bernard&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
&lt;em&gt;
A brief intro to simulating quantum systems with QuTiP.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;
With the reincarnation of &lt;em&gt;Linux Journal&lt;/em&gt;, I thought I'd take this
article through a quantum leap (pun intended) and look at quantum
computing. As was true with the beginning of parallel programming, the next
hurdle in quantum computing is developing algorithms that can do useful
work while harnessing the full potential of this new hardware.
&lt;/p&gt;

&lt;p&gt;
Unfortunately though, most people don't have a handy quantum computer lying around
on which they can develop code. The vast majority will need to
develop ideas and algorithms on simulated systems, and that's fine for such
fundamental algorithm design.
&lt;/p&gt;

&lt;p&gt;
So, let's take look at one of the Python
modules available to simulate quantum systems—specifically,
QuTiP. For this short article, I'm focusing on the mechanics of how to use
the code rather than the theory of quantum computing.
&lt;/p&gt;

&lt;p&gt;
The first step is installing the QuTiP module. On most machines, you can
install it with:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
sudo pip install qutip
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
This should work fine for most people. If you need some
latest-and-greatest feature, you always can install
QuTiP from source by going to the &lt;a href="https://qutip.org/index.html"&gt;home page&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Once it's installed, verify that everything worked by starting up
a Python instance and entering the following Python commands:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
&gt;&gt; from qutip import *
&gt;&gt; about()
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
You should see details about the version numbers and installation paths.
&lt;/p&gt;

&lt;p&gt;
The first step is to create a qubit. This is the simplest unit of data to
be used for quantum calculations. The following code generates a qubit
for two-level quantum systems:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
&gt;&gt; q1 = basis(2,0)
&gt;&gt; q1
   Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket
   Qobj data =
   [[ 1.]
    [ 0.]]
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
By itself, this object doesn't give you much. The simulation kicks in when
you start applying operators to such an object. For example, you can apply
the sigma plus operator (which is equivalent to the raising operator for
quantum states). You can do this with one of the operator functions:

&lt;/p&gt;&lt;pre&gt;
&lt;code&gt;
&gt;&gt; q2 = sigmap * q1
&gt;&gt; q2
   Quantum object: dims = [[2], [1]], shape = (2, 1), type = ket
   Qobj data =
   [[ 0.]
    [ 0.]]
&lt;/code&gt;
&lt;/pre&gt;


&lt;p&gt;
As you can see, you get the zero vector as a result from the application of
this operator.
&lt;/p&gt;

&lt;p&gt;
You can combine multiple qubits into a tensor object. The following code
shows how that can work:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/taking-python-next-level" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Thu, 22 Feb 2018 15:57:52 +0000</pubDate>
    <dc:creator>Joey Bernard</dc:creator>
    <guid isPermaLink="false">1339681 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
