<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Victory's Blog</title>
 <link href="https://vtomole.com/blog/atom.xml" rel="self"/>
 <link href="https://vtomole.com/blog"/>
 <updated>2026-07-12T15:02:14+00:00</updated>
 <id>https://vtomole.com/blog</id>
 <author>
   <name>Victory Omole</name>
   <email>vtomole2@gmail.com</email>
 </author>

 
 <entry>
   <title>Aristotle</title>
   <link href="http://vtomole.com/blog/2026/02/28/aristotle"/>
   <updated>2026-02-28T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2026/02/28/aristotle</id>
   <content type="html">&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#physics&quot;&gt;Physics&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#metaphysics&quot;&gt;Metaphysics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;physics&quot;&gt;Physics&lt;/h2&gt;

&lt;h3 id=&quot;book-i&quot;&gt;Book I&lt;/h3&gt;

&lt;p&gt;At the end of &lt;a href=&quot;https://classics.mit.edu/Aristotle/physics.1.i.html&quot;&gt;Book I of Aristotle’s Physics&lt;/a&gt;, he claims that he has sufficiently argued that there are principles, that he has shown what those principles are, and that he has determined how many of them there are. Why should we care about principles? Because principles are the doors to scientific knowledge. Aristotle draws on his predecessors, who all agree that contraries are principles. Examples of contraries include excess and defect, above and below, before and behind, angular and angle-less, straight and round, and so forth. If contraries come in pairs and contraries are principles, then in the abstract, there are 2 principles. As we observe things in our world, we notice that their properties tend to change between the contraries. Things change from hot to cold, wet to dry, e.t.c and vice versa. The things in which the contraries display their properties and which persist through the change is called the substratum, which is the third principle.&lt;/p&gt;

&lt;h3 id=&quot;book-ii&quot;&gt;Book II&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://classics.mit.edu/Aristotle/physics.2.ii.html&quot;&gt;Book II&lt;/a&gt; gives an account of the primary causes. What is a cause? It is that from which a thing comes to be and that from which it persists. In a single paragraph Aristotle summarizes all of them:&lt;/p&gt;

&lt;p&gt;“All the causes now mentioned fall into four familiar divisions. The letters are the causes of syllables, the material of artificial products, fire, &amp;amp;c., of bodies, the parts of the whole, and the premises of the conclusion, in the sense of ‘that from which’. Of these pairs the one set are causes in the sense of substratum, e.g. the parts, the other set in the sense of essence-the whole and the combination and the form. But the seed and the doctor and the adviser, and generally the maker, are all sources whence the change or stationariness originates, while the others are causes in the sense of the end or the good of the rest; for ‘that for the sake of which’ means what is best and the end of the things that lead up to it. (Whether we say the ‘good itself’ or the ‘apparent good’ makes no difference.)”&lt;/p&gt;

&lt;p&gt;The first set of causes; the ones that define the letters of syllables, the material of artificial products, the parts of the whole, etc.; are those that Aristotle describes as “that from which.” In general, these correspond to form and matter, where matter, for example, the substratum, which we discovered in Book I to be a principle, is also a cause.
The third cause comes from “all sources whence change and stationariness originate”; this is the efficient cause. The “that for the sake of which” is called the final cause.&lt;/p&gt;

&lt;h3 id=&quot;book-iii&quot;&gt;Book III&lt;/h3&gt;

&lt;p&gt;In &lt;a href=&quot;https://classics.mit.edu/Aristotle/physics.3.iii.html&quot;&gt;Book III&lt;/a&gt;, we defined nature as a principle of motion. Since nature is a principle of motion, we cannot understand nature before we understand motion. Since motion is continuous, and the infinite presents itself in the continuous, we must understand the infinite first and foremost. We must understand the way in which the infinite exists, the way in which it does not exist, and what it is. Since motion is concerned with bodies, we ask: does an infinite body exist? A proof that an infinite body does not exist goes as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The definition of a body is “bounded by a surface.”&lt;/li&gt;
  &lt;li&gt;The infinite is unbounded.&lt;/li&gt;
  &lt;li&gt;Therefore, an infinite body cannot exist because it would be unbounded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, given that an infinite body does not exist, that does not mean that the infinite does not exist in other ways. The infinite must exist because, if it did not, time would not be infinite.&lt;/p&gt;

&lt;h3 id=&quot;book-iv&quot;&gt;Book IV&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://classics.mit.edu/Aristotle/physics.4.iv.html&quot;&gt;Book IV&lt;/a&gt; addresses place, void, and time.&lt;/p&gt;

&lt;p&gt;Place cannot be a body because, if it were, there would be two bodies in the same place, which is impossible. Place is, in a sense, a home for the body, and bodies have their natural places: the place for fire is up, and the place for earth is down. Thus, these bodies tend to move up or down to their appropriate places. What is the cause of place? It cannot be matter or form, since form and matter are not separate from things, whereas place can be separated from things. For example, an empty cup is filled with air, but when water is poured into it, the air exits the cup, and the cup is then filled with water. The place that contained air now contains water, but it is still the same place, independent of what body occupies it.&lt;/p&gt;

&lt;p&gt;While place exists, the void, on the other hand, does not. What is the void? The void is a place without a body. It is very hard to imagine such a thing, because when air makes room for water, the air must move to some other place. The existence of a void would mean a world in which things do not move from place to place. This is because, unlike place, the void yields to any body. If so, then a body would move into any empty place, and something like fire, which would normally move up, would be equally justified in moving in any direction, including down.&lt;/p&gt;

&lt;p&gt;What about time? Does it exist? What is its nature? Previous thinkers thought that time is motion. They saw things around them moving and took that to be what time is. But motion is not time. Motion exists only in moving things, whereas time is everywhere, in moving things and in things at rest. Even though time is not motion, it is related to motion: if the state of our mind does not change (that is, if it is not in motion), we would not be aware of the passage of time. How is this relation perceived? Things in motion are described in terms of “before” and “after”: before a body moved, it was located at X; after the body moved, it was located at Y. Time also has this distinction of “before” and “after” because it is related to movement. We are only qualified to claim that time has elapsed when we have sensed the “before” and “after” of a thing in motion. In “before” and “after”, there are two “nows”. “Now” the object is at X; then, after waiting for a period of time, we identify a second now: “now the object is at Y.” The “nows” are what bound time. If there is only one “now”, there is no time, because nothing has moved. Only when there is more than one “now” do we say there is time. So time is the number of motion in respect to “before” and “after”.&lt;/p&gt;

&lt;h3 id=&quot;book-v&quot;&gt;Book V&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://classics.mit.edu/Aristotle/physics.5.v.html&quot;&gt;Book V&lt;/a&gt; goes back to thinking about motion proper. Motion is a kind of change, and there are three ways a thing can change. It can change accidentally, it can change when a part of the whole changes, and it can change in a third way, namely, when it is neither of the first two: when the thing itself is in motion, was not moved accidentally, and it is the whole thing rather than just a part of it.&lt;/p&gt;

&lt;p&gt;Now, each of these three kinds of change might occur in the following ways: from thing to thing, from nothing to thing, from thing to nothing, and from nothing to nothing. But wait, does something changing from nothing to nothing count as a change? It does not, because we have defined change as belonging to a process that involves an opposition of contraries. The change from nothing to something we call “becoming” and the change from something to nothing we call “perishing”. Perishing turns out not to be motion, since motion has for its contrary either another motion or rest, whereas “perishing” is the contrary of “becoming”. Therefore, it is impossible for that which is not to be in motion. This being so, it follows that “becoming” cannot be a motion, for it is that which “is not” that “becomes”. It then follows that only changing from subject to subject counts as motion. Motion is one kind of change, while becoming and perishing are also changes that are themselves not motion.&lt;/p&gt;

&lt;p&gt;Now that we have defined motion as something that belongs to contraries, we must provide examples. Motion appears to have two contraries in general. The first contrary is rest. The other contrary occurs when one motion goes from a contrary to its opposite, while another motion goes from that opposite back to the original contrary. For example, a motion from health to disease, coupled with a motion from disease to health, are contrary motions; while a motion from health and a motion to health are not contrary motions. Neither is a motion from health and a motion from disease, nor a motion to health and a motion to disease, nor a motion from health and a motion to disease.&lt;/p&gt;

&lt;h2 id=&quot;metaphysics&quot;&gt;Metaphysics&lt;/h2&gt;

&lt;h3 id=&quot;book-i-1&quot;&gt;Book I&lt;/h3&gt;

&lt;p&gt;Book 1 of &lt;a href=&quot;https://classics.mit.edu/Aristotle/metaphysics.1.i.html&quot;&gt;Aristotle’s Metaphysics&lt;/a&gt; provides a survey of the history of philosophy, advancing the thesis that previous thinkers discovered the four causes, albeit somewhat obscurely.&lt;/p&gt;

&lt;p&gt;What causes did the ancient philosophers recognize?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Thales: The first principle is water.&lt;/li&gt;
  &lt;li&gt;Anaximenes and Diogenes: The first principle is air.&lt;/li&gt;
  &lt;li&gt;Hippasus and Heraclitus: The first principle is fire.&lt;/li&gt;
  &lt;li&gt;Empedocles: The first principles are fire, water, air, and earth.&lt;/li&gt;
  &lt;li&gt;Anaxagoras: The first principles are infinite.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these principles are material, so, at a minimum, these thinkers recognized material causes.&lt;/p&gt;

&lt;p&gt;Hesiod recognized that among existing things there must be a cause that moves things and brings them together. Hence, Hesiod recognized the efficient cause.&lt;/p&gt;

&lt;p&gt;The Pythagoreans implicitly noticed the formal cause: they thought that number was the substance of all things. Things can change, but numbers would still be the underlying essence of objects. Unlike the proponents of material causes, the Pythagoreans were able to explain justice, the soul, reason, opportunity, and other things through modifications of numbers. They found that the modification of numbers gives form to things.&lt;/p&gt;

&lt;p&gt;Empedocles noticed the final cause. He was the first to assert that, for example, friendship is the cause of good things, and thus to suggest that the good is a cause.&lt;/p&gt;

&lt;p&gt;In arguing that previous thinkers did not fully grasp the four causes, Aristotle presents Empedocles as an example. Empedocles said that the essence and substance of a thing is its ratio, but he does not reconcile this claim with his other claim that the first principles are fire, earth, water, and air. He is grasping at the formal cause, but he does not articulate it clearly.&lt;/p&gt;

&lt;h1 id=&quot;book-2&quot;&gt;Book 2&lt;/h1&gt;

&lt;p&gt;Aristotle admits that there must be some common ground between arguers for them to make progress in an argument.  If the arguers don’t share a common ground, they would be talking past each other, and even worse, they would be unintelligible to each other.  That’s why it’s best to learn how to argue in a variety of ways. One needs to know how to argue mathematically, poetically, and concretely and to learn all these ways first before even attempting to get into the arguments because it’s very hard to learn to absorb every which way of arguing while being productive in an argument.&lt;/p&gt;

&lt;p&gt;When it comes to mathematical arguments, they shouldn’t be applied to arguments about nature because, since nature is made of matter and mathematics has no matter, then the method of studying natural science should not go by the way of mathematics. Aristotle is implicitly making a differentiation between &lt;em&gt;a priori&lt;/em&gt; and &lt;em&gt;a posteriori&lt;/em&gt; knowledge, with the mathematical arguments being a  &lt;em&gt;a priori&lt;/em&gt; and the arguments about nature, poetic citations and concrete arguments coming from &lt;em&gt;a posteriori&lt;/em&gt; knowledge.&lt;/p&gt;

&lt;p&gt;Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/134&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Venture Capital Beyond Returns</title>
   <link href="http://vtomole.com/blog/2025/12/24/doriot"/>
   <updated>2025-12-24T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2025/12/24/doriot</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/American_Research_%26_Development_Corporation&quot;&gt;ARD&lt;/a&gt; was the first venture capital firm, which for some time was led by &lt;a href=&quot;https://en.wikipedia.org/wiki/Georges_Doriot&quot;&gt;Georges Doriot&lt;/a&gt;. How did Georges run ARD? &lt;a href=&quot;https://thebhc.org/sites/default/files/beh/BEHprint/v023n2/p0001-p0026.pdf&quot;&gt;The Rise and Fall of Venture Capital&lt;/a&gt; provides a hint with the following paragraph:&lt;/p&gt;


&lt;blockquote&gt;During the course of his tenure at ARD, Doriot&apos;s vision was not one of &quot;making money&quot; but rather financing &quot;noble&quot; ideas. The first investment made by ARD in 1947 was in High Voltage Engineering Company. The firm, founded by several MIT professors, was established to develop X-ray technology for the treatment of cancer. ARD invested in the company for reasons noted by Compton&apos;s comment to Doriot: &lt;i&gt;They [High Voltage Engineering Company] probably won&apos;t ever make any money, but the ethics of the thing and the human qualities of treating cancer with X-rays are so outstanding that I&apos;m sure it should be in your [Doriot&apos;s] portfolio.&lt;/i&gt; When High Voltage went public in 1955, the original 200,000 dollar investment was worth $1.8 million.
&lt;/blockquote&gt;

&lt;p&gt;Doriot was not worried about his portfolio making a return; instead, he focused on funding ideas that inspired him, and he ended up making a return on this investment anyway. He may have lost money on other noble ideas, but even return-focused VCs rely on rare home runs.&lt;/p&gt;

&lt;p&gt;This worldview offers a lesson for quantum computing. Quantum computing is still in its infancy, with uncertain timelines and unclear commercial applications. This makes it hard for return-driven investors to justify funding. Private quantum financing can be viewed in two ways: the “increase return” interpretation and the “noble ideas” interpretation. The “increase return” view is dominant, but Doriot is a paradigm example that “noble ideas” is plausible. Quantum breakthroughs will depend on investors who, like Doriot, see value beyond the balance sheet.&lt;/p&gt;

Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/109&quot;&gt;GitHub&lt;/a&gt;

</content>
 </entry>
 
 <entry>
   <title>Marcus Aurelius</title>
   <link href="http://vtomole.com/blog/2025/12/14/aurelius"/>
   <updated>2025-12-14T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2025/12/14/aurelius</id>
   <content type="html">&lt;p&gt;Aurelius’ straightforward style of philosophizing in  &lt;a href=&quot;https://www.gutenberg.org/cache/epub/2680/pg2680-images.html&quot;&gt;Meditations&lt;/a&gt;  is a refreshing change from the dominant academic approach to philosophy. Aurelius is not interested in teaching or researching. He doesn’t make arguments because he doesn’t need to. The arguments for why one should care only about virtue and live life according to reason, while remaining indifferent to everything else, had already been put forward by Socrates. Marcus is too busy being an emperor. He simply wants to use philosophy as a tool to make his life tolerable: philosophy as therapy.&lt;p&gt;
&lt;p&gt;
  Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/115&quot;&gt;Github&lt;/a&gt;
&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Marathon Debut</title>
   <link href="http://vtomole.com/blog/2025/10/10/marathon-debut"/>
   <updated>2025-10-10T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2025/10/10/marathon-debut</id>
   <content type="html">&lt;p&gt;
I ran my first &lt;a href=&quot;https://en.wikipedia.org/wiki/Twin_Cities_Marathon&quot;&gt;marathon&lt;/a&gt; last weekend. I finished in 2:56:13, placing 122nd out of 7,346 runners. My splits were as follows:

  &lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;
&lt;tr&gt;&lt;th&gt;Segment&lt;/th&gt;&lt;th&gt;Split Time&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;0K–5K&lt;/td&gt;&lt;td&gt;20:51&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5K–10K&lt;/td&gt;&lt;td&gt;21:04&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10K–15K&lt;/td&gt;&lt;td&gt;21:04&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;15K–20K&lt;/td&gt;&lt;td&gt;20:45&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;20K–25K&lt;/td&gt;&lt;td&gt;19:37&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25K–30K&lt;/td&gt;&lt;td&gt;20:04&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;30K–35K&lt;/td&gt;&lt;td&gt;21:17&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;35K–40K&lt;/td&gt;&lt;td&gt;22:22&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

As observed, 35K to the finish line was brutal. It’s interesting how time slowed down from 35K on. It felt like the race would never end, but with enough patience, it did end.

&lt;/p&gt;


&lt;p&gt;
  Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/109&quot;&gt;Github&lt;/a&gt;
&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Plato</title>
   <link href="http://vtomole.com/blog/2025/05/18/plato"/>
   <updated>2025-05-18T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2025/05/18/plato</id>
   <content type="html">&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#sophist&quot;&gt;Sophist&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#statesman&quot;&gt;Statesman&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#philebus&quot;&gt;Philebus&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#timaeus&quot;&gt;Timaeus&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#critias&quot;&gt;Critias&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#apology&quot;&gt;Apology&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#charmides&quot;&gt;Charmides&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#crito&quot;&gt;Crito&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#euthyphro&quot;&gt;Euthyphro&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#gorgias&quot;&gt;Gorgias&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#hippias-minor&quot;&gt;Hippias Minor&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#meno&quot;&gt;Meno&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#phaedo&quot;&gt;Phaedo&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#phaedrus&quot;&gt;Phaedrus&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#symposium&quot;&gt;Symposium&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#theaetetus&quot;&gt;Theaetetus&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;sophist&quot;&gt;Sophist&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Parmenides&quot;&gt;Parmenides&lt;/a&gt;, a forefather of the tradition that Plato is engaged in, is quoted in the &lt;a href=&quot;https://www.gutenberg.org/files/1735/1735-h/1735-h.htm#link2H_4_0002&quot;&gt;Sophist&lt;/a&gt; as advising people to avoid trying to show the existence of non-being,
because such a task is doomed from the start. What Parmenides means by this is that, because being has to do with things that exist, non-being has to do with things that don’t exist.
You can’t prove that things that don’t exist do exist. In a classic case of disobeying one’s elders, Plato goes against Parmenides’ advice and, by using the concept of motion, proceeds to prove the existence of non-being.
The proof goes roughly as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Things are either in motion or at rest.&lt;/li&gt;
  &lt;li&gt;Rest and motion don’t mix.&lt;/li&gt;
  &lt;li&gt;Since we are talking about non-being, we have to talk about being.&lt;/li&gt;
  &lt;li&gt;Being applies to both motion and rest.&lt;/li&gt;
  &lt;li&gt;Being can’t be motion or rest, because if it were (for example, rest), then motion would participate in rest, which is impossible.&lt;/li&gt;
  &lt;li&gt;We now have three categories: being, motion, and rest.&lt;/li&gt;
  &lt;li&gt;Being is the same as itself and different from motion and rest.&lt;/li&gt;
  &lt;li&gt;Rest is the same as itself and different from motion and being.&lt;/li&gt;
  &lt;li&gt;Motion is the same as itself and different from rest and being.&lt;/li&gt;
  &lt;li&gt;We have used “the same” and “different” to categorize being, rest, and motion. Which categories do “the same” and “different” belong to?&lt;/li&gt;
  &lt;li&gt;“The same” and “different” must be their own categories. For example, if “the same” were motion, then point number 9 would say “Rest is motion, which is different from motion and being,” which is impossible.&lt;/li&gt;
  &lt;li&gt;We now have five categories: being, motion, rest, the same, and different.&lt;/li&gt;
  &lt;li&gt;Building on point number 8: If being is different from motion, then motion is different from being.&lt;/li&gt;
  &lt;li&gt;This is the same as saying “Motion is non-being with respect to being.”&lt;/li&gt;
  &lt;li&gt;Motion exists, and it is not being.&lt;/li&gt;
  &lt;li&gt;Non-being exists, and it is difference—not the opposite of being—thus refuting Parmenides’ claim.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;statesman&quot;&gt;Statesman&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.gutenberg.org/files/1738/1738-h/1738-h.htm#link2H_4_0002&quot;&gt;Statesman&lt;/a&gt; is an example of how to define a scientific field.
The &lt;a href=&quot;https://en.wikipedia.org/wiki/Eleatics&quot;&gt;Eleatic&lt;/a&gt; Stranger and a young Socrates have gathered to discuss an area of science: the science of the political.
The classification of political science goes as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Science
    &lt;ul&gt;
      &lt;li&gt;Theoretical
        &lt;ul&gt;
          &lt;li&gt;Individual Contributor&lt;/li&gt;
          &lt;li&gt;Manager&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Practical&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The division between the theoretical and practical is akin to the division between knowledge work and manual labor.
The individual contributor is engaged in knowledge work that does not need to be passed off to others, while the manager does. The mathematician is an individual contributor, while the statesman is not,
so we climb down the “Manager” node on this tree of science:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Manager
    &lt;ul&gt;
      &lt;li&gt;Middle Manager&lt;/li&gt;
      &lt;li&gt;Upper Manager
        &lt;ul&gt;
          &lt;li&gt;Herdsman
            &lt;ul&gt;
              &lt;li&gt;Animals&lt;/li&gt;
              &lt;li&gt;Humans&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;Master-Workman&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tree in Plato’s text is more detailed than the one displayed here, but we see that the division has been made between middle management and upper management. Middle management passes on instructions from elsewhere, while upper management forges and passes on their own instructions.
A prophet who passes on the instructions of God to the people is middle management.&lt;/p&gt;

&lt;p&gt;Following the none of the “Upper Manager”, we see that this science divided into the work of the master-workman and herdsman: the management of non-living things and living things, respectively.
Notice, as we go farther down the tree, the more the lines between a practical science and a theoretical science are blurred. The mathematician only needs to worry about abstract objects,
but a master-builder, such as an engineer, has to be concerned with the actions of the beings he’s controlling in order to be successful.
This applies to the herdsman and, with that, the statesman.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href=&quot;https://plato.stanford.edu/entries/plato-sophstate/&quot;&gt;Method and Metaphysics in Plato’s Sophist and Statesman&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;philebus&quot;&gt;Philebus&lt;/h2&gt;

&lt;p&gt;In the &lt;a href=&quot;https://www.gutenberg.org/files/1744/1744-h/1744-h.htm#link2H_4_0002&quot;&gt;Philebus&lt;/a&gt;, the discussion centers on which way of life is better: the life of the mind or the life of pleasure.
To begin answering this question, Socrates first divides all existing things into three categories: the infinite, the finite, and a composition of the infinite and the finite.
There is difficulty in understanding the third category during the discussion, so Socrates begins to talk about how everything that comes into being has a cause.
This cause of the composition of the finite and infinite becomes the fourth category.
Socrates ultimately shows that pleasure belongs to the first class and mind belongs to the fourth class.
He then concludes that a life combining mind and pleasure is better than a life consisting solely of mind or solely of pleasure.
Even though a good life requires both pleasure and knowledge, we still need to determine how to rank them.
Does a good life require more pleasure than knowledge, less pleasure than knowledge, or should they be distributed evenly?
If we look into knowledge, we see that there is a science of measuring and counting.
This science, the dialectic, which is akin to mathematics, is closer to truth, in terms of clearness and correctness, than all the other sciences. In the end, the ranking is as follows:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Dialectical science&lt;/li&gt;
  &lt;li&gt;The beautiful&lt;/li&gt;
  &lt;li&gt;Wisdom&lt;/li&gt;
  &lt;li&gt;Arts and non-dialectical sciences&lt;/li&gt;
  &lt;li&gt;Pleasure&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;timaeus&quot;&gt;Timaeus&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gutenberg.org/cache/epub/1572/pg1572-images.html#link2H_4_0010&quot;&gt;Timaeus&lt;/a&gt; weaves together the natural and the supernatural sciences to provide an explanation of how the universe was created by a creator.
This creator believed that all things should be ordered and good, like himself. The creator looked around and saw only disorder.
He brought order by using fire, air, and water to create immortal and invisible souls. He then created visible bodies, such as the planets, moon, sun, and stars, to house these souls.
Next, he created gods and instructed them to create people, whose souls are a mixture of the mortal and the immortal.
Each person was assigned a star, and if they lived righteously, they would return to their star.
If they lived unrighteously, they would be &lt;a href=&quot;https://en.wikipedia.org/wiki/Reincarnation&quot;&gt;reincarnated&lt;/a&gt; as a non-human animal. If the person lived unrighteously,
they would be reincarnated as a bird if they were light-minded, as a fish if they were ignorant, or as a non-human animal if they lacked philosophy.&lt;/p&gt;

&lt;h2 id=&quot;critias&quot;&gt;Critias&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gutenberg.org/cache/epub/1571/pg1571-images.html#link2H_4_0002&quot;&gt;Critias&lt;/a&gt; says that anything that can be said is only a representation. When we describe mountains, stars, trees, and other things, we grant these descriptions some slack because we don’t
really know these things well enough to criticize how accurately the descriptions represent the real thing. The descriptions can’t be obviously wrong, and we can say, “Yeah, that’s pretty close to a tree.”
This slack can’t be granted to descriptions of human beings because we are human beings ourselves.
This makes us much more perceptive of interpretations of humans in a way we wouldn’t be for descriptions of other things.
This is why Critias asks Socrates to indulge him in his interpretation of the Ancient Athenians and Atlanteans. What does this interpretation of these two civilizations entail?&lt;/p&gt;

&lt;p&gt;Well, 9,000 years ago, different gods governed different portions of land. One portion was governed by Hephaestus and Athena,
who loved philosophy and art. They gave this land its laws, which led to it being a well-governed city, but it was unfortunately washed away by rains and earthquakes.
The remnants of that city can still be seen, for example, in the small streams left over from the fountain that was in the Acropolis. These Ancient Athenians were well known all over the world for their beauty and wisdom.&lt;/p&gt;

&lt;p&gt;Poseidon’s portion of land was Atlantis. It was ruled by kings who met every few years and passed judgment on their citizens based on the laws handed down by Poseidon.
Atlantis had wealth in abundance, and all its citizens lived in harmony according to law. But their human nature started getting the upper hand,
and Zeus noticed that this was the beginning of their downfall. Zeus decided to punish them in order to help them remember their roots. Zeus gathered the gods
together, and they decided that Athens and Atlantis should go to war.&lt;/p&gt;

&lt;p&gt;The dialogue is cut short before we hear Socrates’ response to this interpretation.&lt;/p&gt;

&lt;h2 id=&quot;apology&quot;&gt;Apology&lt;/h2&gt;

&lt;p&gt;A 70-year-old &lt;a href=&quot;https://www.gutenberg.org/cache/epub/1656/pg1656-images.html#chap02&quot;&gt;Socrates is put on trial&lt;/a&gt; for corrupting the aristocratic youth of Greece. The young, wealthy men do not have to work and thus have a lot of time on their hands to listen to a
man who questions the essence of things like truth, justice, and knowledge. Interestingly, his prosecutors cannot seem to point exactly to why what he is doing is wrong.
There are some vague accusations of him being an atheist, which Socrates disproves by showing that he believes in spiritual agencies and thus cannot be an atheist.
It seems that the government is simply annoyed by his questioning. They are even more annoyed that the youth are imitating him.&lt;/p&gt;

&lt;p&gt;A god once declared that Socrates was the wisest of men. In order to prove the god wrong, because he did not believe he was the wisest,
Socrates went around town interviewing politicians, artisans, poets, and rhetoricians in a quest to find people wiser than himself.
During these interviews, he learned that these people are not wise because they do not question the essence of things.
Socrates does himself no favors when he calls out these people for not being wise, especially by doing so in front of their friends, thereby embarrassing them.
But the state did not put him to death for simply being antisocial; he could not have been the only annoying person in Greece at the time!
The state correctly perceived that the &lt;em&gt;sort of questioning&lt;/em&gt; Socrates was engaged in was a threat to society and it had to be stopped by first making an example of its master.&lt;/p&gt;

&lt;h2 id=&quot;charmides&quot;&gt;Charmides&lt;/h2&gt;

&lt;p&gt;Socrates interviews a young &lt;a href=&quot;https://www.gutenberg.org/files/1580/1580-h/1580-h.htm#link2H_4_0005&quot;&gt;Charmides&lt;/a&gt; to discern whether he possesses wisdom.
But what is wisdom? Wisdom is self-knowledge and is the essence of knowledge.
Since wisdom concerns knowledge, it must be a science. But what is the subject of this science? Apparently, it is the science of itself,
the science of other sciences, and the science of the absence of science.&lt;/p&gt;

&lt;p&gt;Wisdom is unique among the sciences because other sciences are about things other than themselves. For example, architecture is the science of building design,
not the science of architecture itself. This distinction suggests that we cannot treat wisdom as we do other sciences.&lt;/p&gt;

&lt;p&gt;Whether such a science is possible is a question left for future inquiry. Even if such a science exists, we must ask whether it benefits us and thus deserves to be called wisdom,
since wisdom ought to be advantageous. Wisdom, understood as self-knowledge, cannot itself teach other sciences, so it offers no direct advantage there.
The only possible benefit is that, by knowing what we know and do not know, wisdom might make it easier to learn other sciences.
Beyond that, it’s doubtful that Charmides will gain any advantage in life from having wisdom&lt;/p&gt;

&lt;h2 id=&quot;crito&quot;&gt;Crito&lt;/h2&gt;

&lt;p&gt;While Socrates is in prison awaiting his execution, his friend
&lt;a href=&quot;https://www.gutenberg.org/cache/epub/1657/pg1657-images.html&quot;&gt;Crito&lt;/a&gt;
attempts to persuade him to escape. However, Socrates refuses, and he explains his reasoning as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Some opinions are to be respected, while others are not.&lt;/li&gt;
  &lt;li&gt;It is better to obey the opinion of one (in this case, “reason”) than the opinion of the many.&lt;/li&gt;
  &lt;li&gt;The opinion of the many is that Socrates should escape for the sake of his family and friends.&lt;/li&gt;
  &lt;li&gt;Reason, however, tells him:
    &lt;ul&gt;
      &lt;li&gt;It is better to do good than to do evil.&lt;/li&gt;
      &lt;li&gt;Injuring and doing evil are the same thing.&lt;/li&gt;
      &lt;li&gt;When injured, do not injure in return, as that would be to do evil.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since the state is injuring Socrates by condemning him to death, does that mean he should injure the state by breaking its laws? (Here, the law being broken would be escaping from prison.) Socrates answers “no,” because breaking the law would be doing evil. If a law is unjust, one should seek to persuade the state that the law is unjust, rather than harming the state by disobeying its laws.&lt;/p&gt;

&lt;p&gt;Therefore, Socrates must die as the Athenian laws command, if he wishes to remain a good man rather than become an evil one, as reason demands.&lt;/p&gt;

&lt;h2 id=&quot;euthyphro&quot;&gt;Euthyphro&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gutenberg.org/cache/epub/1642/pg1642-images.html#link2H_4_0002&quot;&gt;Euthyphro&lt;/a&gt; is prosecuting his father for murder. The case involves Euthyphro’s father leaving a field laborer
who had killed a domestic servant in a ditch while awaiting guidance from religious authorities on what should be done with the laborer. During the wait, the laborer died of exposure, prompting Euthyphro’s charge.&lt;/p&gt;

&lt;p&gt;Meanwhile, Socrates faces accusations of impiety. Curious about Euthyphro’s confidence in his own piety for prosecuting his father, Socrates seeks to learn the essence of piety and impiety from him.&lt;/p&gt;

&lt;p&gt;Euthyphro initially claims that piety is exemplified by his own action: prosecuting his father for murder.
Socrates finds this unsatisfactory, as citing examples does not reveal the underlying nature of piety.
When pressed, Euthyphro defines piety as doing what pleases the gods and impiety as doing what displeases them.
Socrates points out that the gods often disagree, so the same act could be considered pious by some gods and impious by others.
For instance, Zeus might approve of Euthyphro’s prosecution because Zeus prosecuted his father, while Cronos, having been persecuted by his own sons, would not.&lt;/p&gt;

&lt;p&gt;To resolve this, Socrates suggests that piety is what all the gods agree upon. With this new definition, the authority of piety shifts from the gods to their consensus,
implying that piety exists independently of the gods. Once cornered into implicitly admitting that the gods don’t have authority over piety,
Euthyphro is no longer interested in the exercise. He decides to leave, and Socrates fails to get to the essence of piety through Euthyphro.&lt;/p&gt;

&lt;h2 id=&quot;gorgias&quot;&gt;Gorgias&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gutenberg.org/cache/epub/1672/pg1672-images.html#chap02&quot;&gt;Gorgias&lt;/a&gt;, a professor of rhetoric, attempts to define his craft. His craft is the art of persuasion,
aimed at the public. Rhetoricians need not be experts in the subjects they discuss. With their oratory skills, they can convince the public of anything.
In fact, they are often able to persuade the public on matters outside their expertise even more effectively than the experts can.
For example, Gorgias recounts how he was able to convince a patient to take his medicine, despite the doctor’s inability to persuade the patient.&lt;/p&gt;

&lt;p&gt;If rhetoricians have the power to convince the public of anything they wish, what prevents them from engaging in fraud? There must be some form of ethics governing rhetoric,
or else Greek society would not have held the profession in such high esteem. Unlike Socrates, Gorgias does not try to ground his ethics.
He claims that as long as rhetoricians do not damage the expert’s reputation, they are not misusing their powers.
According to Gorgias, if the patient continues to regard the doctor as reputable after encountering the rhetorician, no harm has been done.
The protection of experts’ reputations guards society from rhetoricians who might otherwise convince the public of anything they please.
If rhetoricians do their job correctly, the public should remain aware that it is the experts who truly possess knowledge.&lt;/p&gt;

&lt;h2 id=&quot;hippias-minor&quot;&gt;Hippias Minor&lt;/h2&gt;

&lt;p&gt;Out of Homer’s two poems, the Iliad and the Odyssey, &lt;a href=&quot;https://www.gutenberg.org/files/1673/1673-h/1673-h.htm#link2H_4_0002&quot;&gt;Hippias&lt;/a&gt; thinks the Iliad is the better poem.
This is because the main character of the Iliad, Achilles, consistently aims to tell the truth but sometimes unintentionally lies. The main character of the Odyssey, Odysseus, on the other hand, intentionally lies.&lt;/p&gt;

&lt;p&gt;Socrates thinks that Odysseus is the better man because he intentionally lies, while Achilles is the lesser man because he unintentionally lies.
To Socrates, ethics is just another art, like archery. An archer who consistently misses the mark is better than an archer who accidentally hits the mark
because the archer who consistently misses is so skilled that he doesn’t rely on chance. If he can consistently miss, then he could also consistently hit the mark if he so wished.
The archer who accidentally misses is the lesser archer because it follows that he would also accidentally hit the mark.&lt;/p&gt;

&lt;p&gt;It’s hard to argue with this logic, and Hippias doesn’t attempt to do so. He simply decides that he doesn’t agree with Socrates.
Most of us would do the same. We know that someone who tries to do right but doesn’t hit the mark 100% of the time is better than someone who is so good at doing wrong that they never err at it.
If a skilled evildoer decides to do right, they will perform better than the unskilled do-gooder.
But for Socrates to call the skilled evildoer who has not converted to doing good the better person than the unskilled do-gooder is confusing
unless Socrates is prioritizing the skills a person possesses over the consequences those skills lead to.&lt;/p&gt;

&lt;h2 id=&quot;meno&quot;&gt;Meno&lt;/h2&gt;

&lt;p&gt;Meno wants to know how people gain virtue: Is it acquired through education or by some other means? Socrates admits that he does not know what virtue is
and has never found anyone who could define it. Meno suggests to Socrates that virtue is a person’s ability to govern a household or a state.
However, after some questioning from Socrates, it becomes clear that virtue is not merely the talent to govern; it can also include health, wealth, and other good things.
There are many virtues, but Socrates, as always, is not interested in the particulars. He wants to discover the essence of virtue: a general definition that encompasses all particular instances.&lt;/p&gt;

&lt;p&gt;When Meno claims that virtue is the desire for honorable things and the power to attain them, Socrates undermines his thesis by concluding that, according to this definition,
everyone is virtuous since everyone desires the good. Meno then revises his position, arguing that virtue is not just the desire for the good but the ability to attain it.
Attaining the good, however, must be done honestly, thus raising the question of what honesty is. Honesty is itself a part of virtue. Socrates and Meno become stuck in a circle;
they cannot make progress in defining virtue because each definition implicitly contains virtuous qualities.&lt;/p&gt;

&lt;p&gt;This cycle reminds Socrates of a myth that religious leaders preach. The myth goes as follows: When a person dies, their immortal soul travels to another world,
where it acquires knowledge of all things. Upon reincarnation, the soul forgets what it learned in that realm. Therefore, learning is an act of recollection,
remembering things the soul once knew but has forgotten.&lt;/p&gt;

&lt;p&gt;To test this hypothesis, Socrates asks Meno’s slave a geometry question that the slave has never been taught.
The slave does not know that (d^2 = 2a^2), where (d) is the length of the diagonal of a square and (a) is the side length.
Nevertheless, through a series of questions posed by Socrates, the slave is able to discover this theorem on his own.&lt;/p&gt;

&lt;p&gt;If geometry can be taught through questioning, then perhaps virtue can also be taught. This suggests that virtue may be a form of knowledge.
However, Socrates doubts that virtue is knowledge because, if it were, it could be taught, and teaching requires both teachers and students.
Yet, there is no one in Athens who can teach virtue. Socrates and Meno never fully succeed in Socrates’ mission, but they do make progress in answering Meno’s question.
If no one can teach virtue, then virtue is not gained through education, but is instead a divine gift.&lt;/p&gt;

&lt;h2 id=&quot;phaedo&quot;&gt;Phaedo&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;https://www.gutenberg.org/files/1658/1658-h/1658-h.htm#link2H_4_0002&quot;&gt;Phaedo&lt;/a&gt; tells Echecrates about the conversation Socrates had with his disciples on the last day before his execution. The context of the dialogue calls for a discussion on the philosophy of death.&lt;/p&gt;

&lt;p&gt;The philosopher desires death because it separates his soul from his body. This is because the philosopher’s mission, to contemplate &lt;a href=&quot;https://en.wikipedia.org/wiki/Theory_of_forms&quot;&gt;Ideas&lt;/a&gt; like
absolute greatness, absolute smallness, is hindered by the body.
However, even though the philosopher desires death, it should not be by his own hand, for the same reason that it is unlawful to escape from prison.&lt;/p&gt;

&lt;p&gt;The soul is immortal and the body is mortal. Proving that the body is mortal is not hard, but proving that the soul is immortal is difficult. We must first prove that the soul existed before birth
and also that it will exist after death. The soul’s existence before birth is sufficiently proved by the same methods employed in the &lt;a href=&quot;#meno&quot;&gt;Meno&lt;/a&gt;: one can observe that the soul learns subjects like geometry
by remembrance of concepts it knew before birth but has now forgotten.&lt;/p&gt;

&lt;p&gt;Proving the soul’s existence after death is difficult, but if one accepts the existence of Ideas, it should be relatively straightforward.
Opposite Ideas coexist but do not exist in the same thing. For example Simmias is greater than Socrates and smaller than Phaedo, but he is not by himself greater or smaller; rather,
he is greater or smaller relative to others. This concept also applies to things that are inseparable from their attributes. If cold and heat are opposed, then fire, which is inseparable from heat,
cannot coexist with cold. It then follows that if life and death are opposed, then the soul, which is inseparable from life, cannot coexist with death. Therefore, the soul is immortal.&lt;/p&gt;

&lt;h2 id=&quot;phaedrus&quot;&gt;Phaedrus&lt;/h2&gt;

&lt;p&gt;Socrates and &lt;a href=&quot;https://www.gutenberg.org/files/1636/1636-h/1636-h.htm#link2H_4_0002&quot;&gt;Phaedrus&lt;/a&gt; address two topics: love and rhetoric.
Let’s focus on the latter. We saw in the &lt;a href=&quot;#gorgias&quot;&gt;Gorgias&lt;/a&gt; how rhetoric is often used to mislead.
In Socrates’ time, there were people called rhetoricians, masters of persuasion. They could convince anyone of anything, and they didn’t care whether what
they were saying was true. One day they could make something seem good, and the next, make that same thing seem evil. These people, often holding
high political positions thanks to their persuasive skills, were respected members of society.&lt;/p&gt;

&lt;p&gt;Socrates, being someone who cares about the truth, couldn’t see himself aligning with the rhetoricians. But he also wanted to persuade others.
He rightly believed that his teachings would be useless if his audience couldn’t be convinced. So, he tells them that his rhetoric is rooted in truth.
Socrates introduces the idea of the “Philosophical Rhetorician”, someone who has seen the truth and can then use rhetorical techniques to persuade.
In fact, the Philosophical Rhetorician must know the truth to be effective at rhetoric, because the more someone understands the truth about their
subject and about human beings, the better they are at deviating from it, if their goal is to convince others of something false.
The responsibility, then, also falls on the audience: they must know the truth to protect themselves from being misled.&lt;/p&gt;

&lt;p&gt;In our time, where knowledge is highly specialized, only a handful of people understand any given subject. It’s easy for experts to mislead,
and it’s unreasonable to expect non-experts to guard against deception because they would need years of training in each of
the subjects to be capable of discerning the truth. For example, an expert might claim that their science will bring enormous returns,
wealth, power, for those who fund it, and the audience would be completely incapable of performing due diligence.
Phaedrus doesn’t address this problem. For now, it seems like we first need to understand how people navigated persuasion
before truth became the central concern so that we may learn from them.&lt;/p&gt;

&lt;h2 id=&quot;symposium&quot;&gt;Symposium&lt;/h2&gt;

&lt;p&gt;In the &lt;a href=&quot;https://www.gutenberg.org/files/1600/1600-h/1600-h.htm#link2H_4_0002&quot;&gt;Symposium&lt;/a&gt;, Phaedrus, Pausanias, Eryximachus, Aristophanes, Agathon, Socrates, and Alcibiades each deliver a speech about love. Agathon and Socrates, unlike the others, who speak about the benefits that &lt;a href=&quot;https://en.wikipedia.org/wiki/Eros&quot;&gt;Eros&lt;/a&gt;, the god of Love has given them, and unlike Alcibiades, who confesses his love for Socrates, focus on the nature of Eros. Given that Agathon, the poet, does not prioritize truth, while Socrates, the philosopher, does, let’s concentrate on Agathon’s speech.&lt;/p&gt;

&lt;p&gt;In summary, Agathon claims that, of all the gods, Eros is the best. He is the youngest: he was not yet born in the time of Homer. In those times, people acted out of necessity, not love. If Eros had been present then, violence would not have been rampant; instead, there would have been peace on earth. Agathon describes Eros as tender, just, graceful, temperate, and offers other beautiful praises. Here is the &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/113#discussioncomment-15252981&quot;&gt;whole speech&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It’s an awe-inspiring speech, one that could convince most people that love is truly the greatest thing there is. But in what way is it not concerned with truth? Agathon does not make rigorous arguments to support his claims about Eros. He heaps words of praise upon Eros without explaining why Eros should possess these qualities.&lt;/p&gt;

&lt;h2 id=&quot;theaetetus&quot;&gt;Theaetetus&lt;/h2&gt;

&lt;p&gt;In the &lt;a href=&quot;https://www.gutenberg.org/files/1726/1726-h/1726-h.htm#link2H_4_0002&quot;&gt;Theaetetus&lt;/a&gt;, Socrates poses the question: “What is the nature of knowledge?”. Theaetetus’ first answer is that the nature of knowledge is perception. If knowledge is perception, then each person has different knowledge. One person may feel that the wind is cold, while another person may perceive the very same wind as being warm. The Sophist Protagoras, summarizes this view: “Man is the measure of all things”.&lt;/p&gt;

&lt;p&gt;If man is the measure of all things, then nothing is stable. One man might measure (that is, perceive) the wind as being cold, while another might measure it as warm. There is no stability in this measure, no external reference by which to claim what the wind really is. This means that the properties of the wind, and anything else that people might measure are in perpetual flux, a theory associated with the philosopher Heraclitus.&lt;/p&gt;

&lt;p&gt;If everything is in flux, then it’s impossible for man to measure anything. A man is incapable of claiming that the wind is cold because the property of the wind is never stable; it changes depending on who you ask. If everything is in flux, nothing can be measured and thus there is no perception to be had because everything is chaos. If Theaetetus is basing his claim on Heraclitus’ doctrine, then he is incapable of maintaining that knowledge is perception without falling into a contradiction, for his claim ultimately implies knowledge is whatever anyone perceives it to be. It can be perception or it can be anything else. Socrates avoids this contradiction by asserting that a wise man, rather than every man, is the measure of all things.&lt;/p&gt;

&lt;h3 id=&quot;references&quot;&gt;References&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://plato.stanford.edu/archives/fall2016/entries/plato-theaetetus/&quot;&gt;Stanford Encyclopedia of Philosophy: Plato on Knowledge in the Theaetetus&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/119&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Quantum computer-aided design</title>
   <link href="http://vtomole.com/blog/2024/02/13/qcad"/>
   <updated>2024-02-13T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2024/02/13/qcad</id>
   <content type="html">&lt;p&gt;
&quot;Useful&quot; is a loaded term. When people say that quantum computers are currently not useful, they mean that quantum computers are currently not &lt;a href=&quot;https://en.wikipedia.org/wiki/Shareholder_value&quot;&gt;maximizing shareholder value&lt;/a&gt;. IBM, Google, various startups, and others work on quantum computing because they hope that it will maximize shareholder value.
The worst-case scenario for shareholder value maximizers is that quantum computing will only improve society indirectly. That is, quantum computing will only remain useful for &lt;a href=&quot;https://en.wikipedia.org/wiki/Basic_research&quot;&gt;basic research&lt;/a&gt;. Given that Post-quantum cryptography invalidates Shor&apos;s algorithm as a potential shareholder useful application and the &lt;a href=&quot;https://dl.acm.org/doi/abs/10.1145/602382.602408&quot;&gt;overwhelming evidence&lt;/a&gt; that quantum computers will only be useful for doing quantum science, how should the quantum computing industry proceed?&lt;/p&gt;

&lt;p&gt;
The best path is to carve out a subfield in quantum computing. The purpose of this subfield is to leverage Feynman&apos;s insight that quantum computers are very good at simulating quantum physics in order to improve the &lt;a href=&quot;https://en.wikipedia.org/wiki/Applications_of_quantum_mechanics&quot;&gt;applications of quantum mechanics&lt;/a&gt;. Shareholder useful applications of quantum mechanics such as atomic clocks, lasers and MRIs included. The subfield we are carving recognizes that quantum computing is a metatechnology: Technology used to design shareholder useful technologies that utilize quantum mechanics.
&lt;/p&gt;
	&lt;p&gt;   
Let&apos;s call this subfield &quot;QCAD&quot; for &quot;Quantum computer-aided design&quot;. It&apos;s a field that uses a quantum computer to design an extremely precise &lt;a href=&quot;https://www.nature.com/articles/s41586-022-04435-4&quot;&gt; atomic clock&lt;/a&gt; or an accurate &lt;a href=&quot;/blog/2022/04/25/nyuad&quot;&gt;virus sensor&lt;/a&gt;. It&apos;s not &lt;a href=&quot;https://en.wikipedia.org/wiki/Computer-aided_design&quot;&gt;classical computer-aided design&lt;/a&gt; but on a quantum computer. That is, it&apos;s not used to design, say, the ramsey cavity, glass rod or vacuum chamber of an atomic clock. It is however, something that allows quantum computing shareholders to create commercial value by licensing the designs that Quantum computer-aided designers generate to organizations that &lt;a href=&quot;https://en.wikipedia.org/wiki/Fabless_manufacturing&quot;&gt;manufacture&lt;/a&gt; shareholder useful quantum technologies.&lt;/p&gt;

Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/67&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Copyright</title>
   <link href="http://vtomole.com/blog/2023/08/14/copyright"/>
   <updated>2023-08-14T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2023/08/14/copyright</id>
   <content type="html">    &lt;p&gt;   
    The &lt;a href=&quot;https://en.wikipedia.org/wiki/Copyright_Act_of_1909#Background&quot;&gt;Copyright Act of 1909&lt;/a&gt; posited that any published work that did not have a copyright notice attached to 
    it was in the public domain. 
    This statute was superseded by the &lt;a href=&quot;https://en.wikipedia.org/wiki/Copyright_Act_of_1976#Subject_matter_of_copyright&quot;&gt;Copyright Act of 1976&lt;/a&gt; which declared the reverse: 
    Any published work that did not have a copyright notice automatically reserved copyrights for the author and the author had to explicitly add a No Copyright notice in order 
    to commit their work to the public domain. This blog has been working under the assumption of the defunct 1909 copyright law. 
    In order to comply with the 1976 law, I’ve added a notice to every page on this site which waivers copyright. &lt;/p&gt;

&lt;p&gt;This formality of wavering copyright gives us a chance to reflect on why this site is in the public domain in the first place. 
    The reason for this site’s existence is for me to learn publicly. 
    The greatest danger of &lt;a href=&quot;https://en.wikipedia.org/wiki/Autodidacticism&quot;&gt;self-teaching&lt;/a&gt; is that it’s extremely difficult to know when you are learning correctly 
    due to having little to no external feedback. 
    This site is for me to put my interpretations of various texts and interpretations of my experiences into writing in an attempt to make said interpretations more clear 
    to myself and allow the public to learn from my learnings. If you want to incorporate my interpretations in your work then the 
    &lt;a href=&quot;https://en.wikipedia.org/wiki/Academic_integrity&quot;&gt;ethics of academia&lt;/a&gt; will ask that you give credit although legally you won&apos;t need to do so. If on the off chance my interpretations help you build a billion dollar quantum business or something crazy like that, 
    the quantum business will be built through your execution not from the work here cause this work is also available to everyone else. 
    The commercial and open source projects I&apos;m involved in are done elsewhere.

    &lt;/p&gt;     
    
Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/64&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Truth as Disclosedness</title>
   <link href="http://vtomole.com/blog/2023/06/10/truth"/>
   <updated>2023-06-10T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2023/06/10/truth</id>
   <content type="html">    &lt;p&gt;    Heidegger’s treatise &lt;i&gt;Being and Time&lt;/i&gt; claims that the question of Being has been forgotten by our society and it needs to be reawakened. 
        The book later goes on an excursion about Truth. Why does talking about Being necessarily mean talking about Truth? 
        Well, the first sentence of 
        &lt;a href=&quot;https://en.wikipedia.org/wiki/Truth&quot;&gt;Wikipedia&apos;s entry&lt;/a&gt; says “Truth is the property of &lt;i&gt;being&lt;/i&gt; in accord with fact or reality”. 
        Notice that the word “being” is contained in Wikipedia’s sentence. 
        Since the question of Being has been forgotten, the ontological foundations of Wikipedia’s definition of Truth, 
        which is the same as the traditional definition of Truth, must be forgotten as well. 
        The founders of Western Philosophy and hence our culture did not define Truth as a correspondence with reality. 
        They defined Truth as Disclosedness but this definition got corrupted into a derivative “Truth as Correspondence”. 
    &lt;/p&gt;

    
    &lt;p&gt;    To demonstrate how the Primordial conception of Truth is Disclosedness, 
        Heidegger studies a phenomenon where someone is turned away from a wall that has a painting who’s frame is askew. 
        The person rightly asserts that the painting on the wall is crooked and then turns around and sees that it is indeed crooked. 
        Now, this phenomena can be interpreted in two different ways, the primordial way and a way that’s derivative of the primordial way.
         The derivative interpretation has been what the West has defined Truth to be for over 2,000 years. 
         This derivative way is to claim that the person&apos;s assertion was true because it corresponded with reality in that they claimed the picture was crooked and it was so.
    &lt;/p&gt;
    
    &lt;p&gt; When this phenomenon is interpreted primordially, we see that before the person’s assertion became 
        true via correspondence, there was an elaborate ontological framework that made it possible for them to assert whether the painting was askew or not. 
        This ontological framework is the Being that’s been forgotten. 
        What does it mean for a painting &lt;i&gt;to be&lt;/i&gt; askew on a wall?. This question has to have an implicit answer before anyone can get to asserting that a painting is askew. &lt;/p&gt;

   
    &lt;p&gt;    A paradigmatic example in Being and Time says that “Before Newton&apos;s laws were discovered, they were not &apos;true&apos; “. 
        With no context,  this statement is very controversial. But it’s only controversial because by default we all go along with “Truth as correspondence”. 
        If we switch to “Truth as Disclosedness” this statement makes sense. 
    &lt;/p&gt;
    
&lt;p&gt;    To bring it close to my home, let&apos;s assert that “A qubit is a two-level quantum system”. Before quantum information theory was disclosed in the late 20th century, 
    this statement would have made no sense whatsoever. It’s only through the founders of quantum information theory that our assertion is true. 
    Yes, atoms existed before Schumacher and Wooters, but the concept of using an atomic system to encode and manipulate  “quantum information” would have been 
    bizarre to Heisenberg, Schrödinger and all the other Quantum 1.0 people who weren’t playing around with desktop computers and more importantly, 
    did their greatest work before Claude Shannon did his best work. Because of Deutsch and Feynman atoms reveal themselves to us as vehicles for storing 
    and manipulating information, not as storage for energy, mechanical systems or as “what everything is made out of” that previous generations of quantum people believed in. 
    This is the Truth of Quantum 2.0.
&lt;/p&gt;    
    
   
    
    
&lt;h3&gt;References&lt;/h3&gt;
&lt;ol&gt;
   &lt;li&gt;Heidegger, Martin. “Dasein, Disclosedness, and Truth.” Being and Time, Blackwell, Oxford, 1967, pp. 256–259.&lt;/li&gt;
&lt;/ol&gt;
Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/45&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Heidegger: Anthropology and Psychology</title>
   <link href="http://vtomole.com/blog/2022/06/26/heidegger-anthropology"/>
   <updated>2022-06-26T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2022/06/26/heidegger-anthropology</id>
   <content type="html">&lt;p&gt;
   In Martin Heidegger&apos;s book &lt;i&gt;Being and Time&lt;/i&gt;, he claims that question of the meaning of being has been forgotten by the West. 
   To reawaken this question, he starts by questioning the meaning of being that we ourselves are; that is, human beings. 
   Most of the book is concerned with studying how human beings behave in their day-to-day lives. Walking to work, taking an elevator, riding a bicycle, socializing with
   others, e.t.c. 
   It&apos;s only natural to ask &quot;Is Heidegger even doing Philosophy? Isn&apos;t he doing science, namely Anthropology or Psychology?&quot;. 
   Heidegger addresses this question in a section titled &lt;i&gt;How the Analytic of Dasein is to be Distinguished from Anthropology, Psychology, and Biology&lt;/i&gt; (Dasein is Heidegger&apos;s word 
   for human being). 
   Anthropology and Psychology are the study of man. The concept of &quot;man&quot; is handed down from our culture: a culture that&apos;s an amalgamation of Ancient Greek and Christian cultures. 
   The Greeks, specifically Aristotle, tell us that man is a Rational animal. The problem is that the kind of being which belongs to an &quot;Animal&quot; is just another 
   object in a world of objects. We are not objects. The kind of being which is &quot;Rational&quot; on the other hand, is very mysterious: &quot;What does it mean to be rational?&quot; is as difficult to tackle 
   as &quot;What does it mean to be a human being?&quot;. Christians by contrast think that man is more than a Rational animal. 
   According to Genesis, man is created in the image and likeness of God. To Christians, the kind being of which belongs to man is Transcendence: something 
   that draws man towards God. But Transcendence is an entity. Since the being of entities (human beings) is not itself an entity (transcendence) 
   due to the &lt;a href =&quot;https://en.wikipedia.org/wiki/Fundamental_ontology&quot;&gt;Ontological difference&lt;/a&gt;, 
   following this path will not help us get closer to the meaning of being of man.
&lt;h3&gt;References&lt;/h3&gt;
&lt;ol&gt;
   &lt;li&gt;Heidegger, Martin, and Martin Heidegger. “How the Analytic of Dasein Is to Be Distinguished from Anthropology, Psychology, and Biology.” Being and Time, Blackwell, Oxford, 1967, pp. 46–50.&lt;/li&gt;
   &lt;li&gt;Heidegger, Martin. “Result of the Critical Reflection: the Neglect of the Question of Being as Such and of the Being of the Intentional Is Grounded in the Fallenness of Dasein Itself.” History of the Concept of Time: Prolegomena, Indiana University Press, Bloomington, 1992, pp. 130–131. &lt;/li&gt;
&lt;/ol&gt;
Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/35&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Quantum Sensing Pirates at NYUAD</title>
   <link href="http://vtomole.com/blog/2022/04/25/nyuad"/>
   <updated>2022-04-25T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2022/04/25/nyuad</id>
   <content type="html">&lt;p&gt;
   A few weeks ago, I was a mentor for the NYU Abu Dhabi Quantum Hackathon for Social Good in the Arab World.
   My team, called the Quantum Sensing Pirates, attempted to build QvsPy: A simulator for programmable quantum sensors.
   We ran out of time to make our simulator programmable so we simulated a quantum sensor
   for COVID detection instead. Why work on a sensing project at a quantum computing hackathon?
   Well, a quantum sensor is similar to a quantum computer
   that characterizes some particular value in its environment.
   Like a quantum computer, a state is initialized but instead of applying gates to the state for
   computation&apos;s sake, the state is left to interact with what we want to sense. By performing measurements on the state
   that&apos;s interacted with the object we are sensing, we can determine the value of that object. For example,
   a quantum sensor exposed to an unknown magnetic field can be used to determine the value of that field.
   Unlike quantum computing, quantum sensing is a mature technology that&apos;s already being used for practical applications.
   Since the theme of the hackathon was to use quantum computing for social good, it was very difficult to think of a practical
   application that wasn&apos;t decades away from being realized. Brainstorming
   social good projects for an immature technology is very difficult and we would not have
   learned how near-term quantum computers can be used to enhance sensing without participating in this hackathon.
   I hope NYUAD continues to host quantum computing hackathons for social good in the future because these types
   hackathons foster an environment that encourages students to be creative.
&lt;/p&gt;
&lt;p&gt;
   Quantum sensors can potentially be used to detect viruses like COVID faster, cheaper and more accurately
   than standard methods like RT-PCR tests. A sample is collected from the patient and exposed to a
   nanodiamond that contains a Nitrogen Vacancy (NV) center. This nanodiamond is coated with a polymer
   which forms reversible complexes with the viral complementary DNA sequences. Magnetic molecules are incorporated with the
   complementary DNA sequences to form a pair. The pairs detach from
   the diamond&apos;s surface in the presence of COVID and the interaction of the pair with COVID will
   create a new compound that will diffuse in the solution. This diffusion will increase the distance between the
   magnetic molecules and the NV center. The magnetic field the NV center detects becomes
   weaker the farther the magnetic molecule is from the NV center. This magnetic field can be measured by
   determining the relaxation (T1) time of the NV center. The weaker the magnetic field, the longer the T1 time.
   For the hackathon, we simulated the results of a T1 experiment that one would get for a sample that contains
   COVID and another for when the sample doesn&apos;t contain COVID.
&lt;/p&gt;
&lt;p&gt;
   The sensitivity of this COVID sensor can be increased with CRISPR technology. The problem is that the sensitivity gained by CRISPR
   cannot approach fundamental limits of precision allowed by quantum physics. This is where programmable quantum sensors
   come into play. Variational quantum sensors: quantum sensors augmented by the variational quantum algorithm, can
   potentially prepare quantum states that achieve the highest sensitivity allowed by quantum mechanics without
   previous knowledge of the sensing device or its environment. Variational quantum sensing
   was recently demonstrated on a Trapped ion quantum computer and we will demonstrate it in QvsPY soon.
   We hope QvsPy will inspire more people to look into how to use near-term quantum computers to improve sensing.
&lt;/p&gt;
&lt;h3&gt;Acknowledgements&lt;/h3&gt;
&lt;p&gt;This project wouldn&apos;t be possible without NYUAD and the Quantum Sensing Pirates: Ashith Farhan, Chin-Ling Hou, 
   Dania Herzalla, Jakub Nowak, Nouhaila Innan, Pengyu Wang, Sakib Sazzad and Zayd Maradni. 
&lt;/p&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;ol&gt;
   &lt;li&gt;&lt;a href = &quot;https://github.com/QCHackers/NYUAD-2022-QSPirates&quot;&gt;QvsPy respository &lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href = &quot;https://pubs.acs.org/doi/pdf/10.1021/acs.nanolett.1c02868&quot;&gt;SARS-CoV-2 Quantum Sensor Based on Nitrogen-Vacancy Centers in Diamond&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href = &quot;https://physics.aps.org/articles/v14/172&quot;&gt;Pushing the Limits of Quantum Sensing with Variational Quantum Circuits2s &lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href = &quot;https://www.nature.com/articles/s41586-022-04435-4&quot;&gt;Optimal metrology with programmable quantum sensors &lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/discussions/29&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title> Husserl's vs. Heidegger's Phenomenology</title>
   <link href="http://vtomole.com/blog/2021/11/06/phenomenology"/>
   <updated>2021-11-06T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2021/11/06/phenomenology</id>
   <content type="html">&lt;p&gt;Edmund Husserl and his student Martin Heidgger were German philosophers who were active in the 20th century. Husserl is the founder of phenomenology; a method which studies Intentionality: The way the human mind is directed towards objects. Phenomenology&apos;s catchphrase “Back to the things themselves” was a reaction to how philosophy had become mainly concerned with theoretical knowledge at the end of the 19th century.
&lt;/p&gt;

&lt;p&gt;Edmund Husserl used phenomenology for epistemology: the investigation of what distinguishes justified belief from opinion. He wanted to make philosophy a rigorous science like mathematics and physics. To make philosophy a rigorous science, Husserl participated in bracketing: putting out of play things that would distract you from focusing on “The things themselves”. For example, bracketing could be listing the qualities of a human being that we can dispense while still being able to call something a human being. Edmund Husserl believed that bracketing is necessary when first-person experiences are analyzed phenomenologically.
&lt;/p&gt;

&lt;p&gt;Heideger, on the other hand, used phenomenology to study ontology: the science of being. To study ontology, Husserl’s bracketing doesn’t go far enough. Unlike Husserl, Heidegger believed that bracketing is impossible because any type of study can’t be presuppositionless. This does not entail throwing the baby out with the bathwater. Bracketing is useful to begin to access the question of being because there are so many prejudices that prevent us from properly doing ontology. To study being, Heidger started with studying the only being which is capable of asking questions about being; human beings. He used the phenomenological method to study the everyday human experiences that come before theory. Everyday experiences like going to the store, playing video games, cooking, watching Netflix (e.t.c) are how we understand being. We mostly don’t lock ourselves in a room to read philosophical and scientific texts while deeply contemplating what it means for something to be.  Since ontology is more fundamental than epistemology, Heidegger surpassed his teacher because his questioning of being showed that theoretical knowledge is not the baseline for how we understand the world. Being something is more fundamental than learning theories and methods on how to be that thing. 
&lt;/p&gt;






    &lt;h2&gt;References&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;Large, William. Heidegger&apos;s &quot;Being and Time&quot;: An Edinburgh Philosophical Guide. Edinburgh University Press, 2010.&lt;/li&gt;
        &lt;li&gt;&lt;a href = &quot;https://journals.sagepub.com/doi/full/10.1177/160940690300200303&quot;&gt;Hermeneutic Phenomenology and Phenomenology: A Comparison of Historical and Methodological Considerations &lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;Blattner, William D. Heidegger&apos;s Being and Time a Reader&apos;s Guide. Bloomsbury, 2013. &lt;/li&gt;
     &lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Feynman vs Schrödinger simulators</title>
   <link href="http://vtomole.com/blog/2020/10/04/feynman_code"/>
   <updated>2020-10-04T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2020/10/04/feynman_code</id>
   <content type="html">&lt;script src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;

$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}|}$
$\newcommand{\norm}[1]{\left\lVert#1\right\rVert}$

&lt;p&gt; The two basic simulation algorithms: Schrödinger&apos;s state-vector algorithm and &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%27s_algorithm&quot;&gt;Feynman&apos;s path algorithm&lt;/a&gt;.  have their pros and cons. While Schrödinger&apos;s takes
    less time to run compared to Feynman&apos;s, it takes more space. Feynman&apos;s trade-off is the opposite of Schrödinger&apos;s: Feynman&apos;s takes more time and less space.
    More precisely, Schrödinger&apos;s takes  $~ m^{2n}$ time and $∼2^{n}$ space while Feynman&apos;s takes $~4^{m}$ time and $∼m+n$ space; where $n$ in the number of qubits
and $m$ is the number of gates.&lt;/p&gt;

    &lt;p&gt;An $n$ qubit quantum computer takes in a quantum circuit $U$ that contains $m$ gates and an input state $\ket{0}^n$. It then outputs a string of bits $x  \in \{0, 1\} ^n$ with probability 
        $P(x_{m}) = |\bra{x_{m}}U\ket{0}^n|^2 $. In  Schrödinger&apos;s algorithm $P(x_{m}) = |\bra{x_{m}}U_{m} U_{m-1} U_{m-2} U_{m-3}, ..., U_{1}\ket{0}^n|^2$; the state is kept track of
    for the entire computation. Contrasted with Feynman&apos;s algorithm,
    $P(x_{m}) = |\bra{x_{m}}U\ket{0}^n|^2 = |\sum_{x_{1}, x_{2}, x_{3}, ... ,x_{m-1} \in \{0, 1\}^n}  \prod_{j=1}^{m} \bra{x_j}U_{j}\ket{x_{j-1}}|^2$&lt;/p&gt;

&lt;p&gt;Feynman&apos;s algorithm saves space because it calculates an amplitude instead of keeping track of the state vector. Not being able
    to inspect a state vector for debugging purposes is a disadvantage of Feynman&apos;s algorithm.
    &lt;/p&gt;


&lt;p&gt;
    Here is an implementation of Feynman&apos;s simulation algorithm: &lt;a href=&quot; https://github.com/vtomole/Kite/blob/master/kite/feynman.py&quot;&gt;feynman.py&lt;/a&gt;. 
    It only works for one and two qubit gates for now. To run it, clone the repository and install the library.
&lt;/p&gt;
&lt;pre class=&quot;prettyprint lang-bash&quot;&gt;
    $ git clone https://github.com/vtomole/Kite.git
    $ cd Kite
    $ pip install e .
&lt;/pre&gt;


&lt;pre class=&quot;prettyprint lang-python&quot;&gt;
    import kite as kt

    def main():
        &quot;To demonstrate the implementation and equivalence of results of the Schrodinger and Feynman simulators&quot;
        prog = kt.Program(
            kt.QREG(2, probability_of_amplitude=&apos;00&apos;),
            kt.H(0),
            kt.CNOT(0,1))
    
        amplitude_from_schrodinger = kt.schrodinger(prog)
        print(&quot;Amplitude from Schrodinger&quot;)
        print(amplitude_from_schrodinger )
    
        amplitude_from_feynman = kt.feynman(prog)
        print(&quot;Amplitude from Feynman&quot;)
        print(amplitude_from_feynman)
        
        assert amplitude_from_schrodinger == amplitude_from_feynman
    
    if __name__ == &apos;__main__&apos;:
        main()
    &lt;/pre&gt;



    &lt;h2&gt;References&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href = &quot;https://arxiv.org/abs/1612.05903&quot;&gt;Complexity-Theoretic Foundations of Quantum Supremacy Experiments&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href = &quot;https://arxiv.org/abs/1803.04402&quot;&gt;Quantum Supremacy and the Complexity of Random Circuit Sampling&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>The Depth of Knowledge</title>
   <link href="http://vtomole.com/blog/2020/01/25/knowledge"/>
   <updated>2020-01-25T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2020/01/25/knowledge</id>
   <content type="html">&lt;section&gt;

&lt;p&gt;&lt;i&gt;&quot;Knowledge of history is stored somewhere. There is a record of everything that took place. There are forces which keep those records in a form that can be interpereted by some consciousness: so that it can understand the events that took place.&quot; 
    - Thomas Grothe (October 3 2019)&lt;/i&gt;&lt;/p&gt;
    
       &lt;!-- &lt;h3&gt; Emergence&lt;/h3&gt; --&gt;
&lt;p&gt;Knowledge’s breadth is greater that it’s depth.&lt;/p&gt;

&lt;p&gt;It doesn’t take long to ask successive “whys” until you reach a limit of human knowledge. A child needs to ask you about 6 “whys&quot; that depend on one another until you don’t know how to answer to her question.&lt;/p&gt;
&lt;p&gt;“Why is the sky blue?” &lt;/p&gt;
&lt;p&gt;“Because the particles in the air scatter blue light more than the other colors.”&lt;/p&gt;
&lt;p&gt; “Why?”&lt;/p&gt;
&lt;p&gt;“Because blue colors travel as short waves.”&lt;/p&gt;
&lt;p&gt;“Why?”&lt;/p&gt;
 &lt;p&gt;After about 3 more “whys”, you’ll have to explain quantum theory and after that you’ll have to explain why quantum theory is the way it is; a question we don’t have an answer to. In Wikipedia, it takes at most 6 clicks to get from one article to another. In  6 degrees of separation, all people are at most 6 social connections away from each other; the “small world” observation &lt;a href=&quot;#separation&quot;&gt;(1).&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An explanation for the observed shallowness of knowledge is Emergence; a phenomenon where a complex system has properties the parts that make it don’t have  &lt;a href=&quot;#separation&quot;&gt;(2)&lt;/a&gt;. Life emerges out of inanimate matter. Love is not just chemicals in your brain; it’s an emergent property of your environment and body. Sampling in Hip hop music illustrates how entirely new sounds can be created by copying pieces of pre-existing sounds. A lot of complexity can be created from simple rules to a point where it’s difficult or impossible to realize which part of a rule created which part of a system. &lt;/p&gt;

&lt;!-- &lt;h3&gt;P VS NP and complexity theory&lt;/h3&gt; --&gt;

&lt;p&gt;An abstract representation of a computer is simple. Called a Turing machine; It’s an infinitely long tape with a head that writes symbols on the tape and instructions on how to operate the machine. The complexity that can arise out of this is machine is tremendous. We can create write books, play games, socialize with people on it .. the list is endless. Since programming a Turing machine is tedious because we have to deal with every detail of the program, we define subroutines which we can use to build other subroutines which allows us to build complicated programs. This type of abstraction is how we are able to compound our knowledge because we don’t have to worry about the details that are irrelevant to the problem we are trying to solve. We couldn&apos;t make progress without abstractions because we would have to start from scratch every time.&lt;/p&gt;


&lt;p&gt;Even though it&apos;s difficult to create knowledge, it&apos;s easy to verify it. It’s easy to recognize a great album or a piece of art but most people would be disoriented if they were tasked to create something similar. This is analogous to the P versus NP problem; where a computer can&apos;t solve some classes of problems efficiently but can efficiently determine that a solution is correct. The combination and thus complexity of work, skills, emotional states and other variables your favorite artist possesses that made him/her create music you like took exponentially more time than for you to appreciate that music. Emergence takes a lot of time. It&apos;s costly for complicated things to create simpler things; where the simpler things are easy to recognize.&lt;/p&gt;
 
&lt;p&gt;Some computer scientists like Avi Wigderson believe that: “If any problem is solved by the brain, then it was an efficiently solvable problem”  &lt;a href=&quot;#avi&quot;&gt;(3)&lt;/a&gt;. This is misleading because it’s not a brain that solved it. It was lots of brains; and not just brains; bodies and environments took part since knowledge is not only passed through genetics, but through human language as well. The amount of knowledge that it took to solve that problem was compounding and abstracting since the beginning of the universe; and now that one brain got the right combination of everything that was designed through billions of years of evolution. Avi seems to be making a comparison of the human brain with Turing machines, but Turing machines start solving most of their problems from scratch. The programs that run human minds have been running for longer and have accumulated a lot of knowledge to be able to solve problems some classes of problems faster than computers. The spontaneous order of emergence is the cause for the sporadic instances of creativity. Once an efficient algorithm is found for a class of problems, then it is easy to solve those problems because there is a formula. It took billions of years for the first airplane to be created. Now an airplane can be built in less than a week.&lt;/p&gt;


&lt;!-- &lt;h3&gt;Category theory, and abstractions and reduction&lt;/h3&gt; --&gt;
&lt;p&gt;One major hindrance to coming up with new ideas is different fields having different cultures which have different notations and terminology. To create ideas that are deemed “original”, one has to spend a lot of time internalizing different representations of different ideas enough to merge them to a point where the combination makes sense. The more disparate the notation for the researcher, the harder it is to cause different ideas to have a happy marriage. Since knowledge is created at an exponential rate, an effort to abstract different classes  knowledge into the same language is important because it&apos;s less cognitive load for the person who’s trying to create knowledge.&lt;/p&gt;

&lt;p&gt;Category theory is a general theory of functions that studies abstract relationships between functions &lt;a href=&quot;#cat&quot;&gt;(4)&lt;/a&gt;. It’s recently been able to connect dissimilar areas like biology, computer science, electrical engineering, topology and chemistry under a common language. This and other attempts to get seemingly different fields under the same mathematical theory will be good for knowledge creation because it will dampen specialization; it will be easier for a biologist to take her idea and apply it to an electrical engineering problem without learning the details of circuit theory.&lt;/p&gt;


&lt;!-- &lt;h3&gt;Constructors&lt;/h3&gt; --&gt;
&lt;p&gt;Complex systems theory; which study how different systems interact with each other is meant to address questions of emergence and abstraction. It can be formalized by the mathematics of automata. Realizing these automata in the physical world is hard because we have to deal with the laws of physics. Like the Turing machine which won’t be able to solve arbitrarily hard classes of problems efficiently, the universal constructor won’t be able to make arbitrary things efficiently. It will take decades for us to build a constructor that constructs things we want. There are many more ways to take advantage of how easily things connect with each other; of    the shallowness of knowledge&lt;/p&gt;






    
            &lt;p&gt;Discuss on &lt;a href=&quot; https://www.reddit.com/user/vtomole/comments/etw5aw/the_depth_of_knowledge/&quot;&gt;Reddit&lt;/a&gt;&lt;/p&gt;
    
            &lt;h2&gt;References&lt;/h2&gt;
            &lt;p&gt;
                &lt;a name=&quot;separation&quot;&gt;&lt;/a&gt; (1) &lt;a href=&quot;https://en.wikipedia.org/wiki/Six_degrees_of_separation&quot;&gt;Six degrees of separation&lt;/a&gt; &lt;/p&gt;
            &lt;p&gt;
                &lt;a name=&quot;emergence&quot;&gt;&lt;/a&gt; (2) &lt;a href=&quot;https://en.wikipedia.org/wiki/Emergence&quot;&gt;Emergence&lt;/a&gt; &lt;/p&gt;
            &lt;p&gt;
                &lt;a name=&quot;avi&quot;&gt;&lt;/a&gt; (3) Wigderson, Avi “&lt;a href=&quot;http://bit.ly/nqt33x&quot;&gt;Knowledge, creativity, and P VS NP&lt;/a&gt;”, 2009.&lt;/p&gt;
            &lt;p&gt;
                &lt;a name=&quot;cat&quot;&gt;&lt;/a&gt; (4) &lt;a href=&quot;https://en.wikipedia.org/wiki/Category_theory&quot;&gt;Category theory&lt;/a&gt; &lt;/p&gt;
    
    &lt;/body&gt;

&lt;/html&gt;


    &lt;section/&gt;</content>
 </entry>
 
 <entry>
   <title>On Robots</title>
   <link href="http://vtomole.com/blog/2020/01/01/robots"/>
   <updated>2020-01-01T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2020/01/01/robots</id>
   <content type="html"> &lt;section&gt;
     &lt;p&gt;&lt;i&gt;&quot;Puzzles to solve and matter to organize. I have a body in this world with muscles that have the potential to incur energy upon matter. 
    I could do more to reach the bounds of the world that my ego inhabits to discover what the self is.&quot; 
- Thomas Grothe (September 9 2019)&lt;/i&gt;&lt;/p&gt;

    &lt;p&gt;Artificial general intelligence(AGI) is a machine that mimics the cognitive functions that humans associate with the human mind, such as &quot;learning&quot; and &quot;problem solving&quot;. Billions are spent on artificial intelligence research a year. Even though tremendous progress has been made in the past decade, we still don&apos;t have cars that can drive themselves in any environment as was promised by experts in the field. This illustrates how formidable the task of creating AGI is. &lt;/p&gt;

    &lt;p&gt;A robot is a programmable computer that can perform a series of tasks. A robot is different from artificial intelligence because it&apos;s not supposed to simulate the human mind. The robots most people tend to imagine are ones that attempt to mimic the movements of the human body.&lt;/p&gt;

    &lt;p&gt;Mimicking the movements of the human body is easier than mimicking the human mind. Most people want an AGI because they believe these machines will be able to solve problems that human beings can&apos;t solve. Even if that&apos;s true, an AGI will have free will so it might decide that it doesn&apos;t want to solve a problem humans want to solve. That is the opposite of a tool! It might be better for mankind to hold the monopoly on knowledge creation; where we can use that knowledge to program robots to perform tasks we want rather than constructing a device that can potentially outhink us.&lt;/p&gt;

    &lt;!-- &lt;h2&gt;3rd digital revolution&lt;/h2&gt;       --&gt;

    &lt;p&gt;We create tools to make our lives easier. Early technological revolutions were in agriculture and manufacturing. Later revolutions have been mostly digital. The current technological revolution merges the manufacturing with digital. The outcome of the current revolution is humans using computers to design and make all physical objects. &lt;a href=&quot;#Niel&quot;&gt;(1)&lt;/a&gt;&lt;/p&gt;

    &lt;p&gt;Software is very easy to scale compared to hardware. Software can be copied on billions of devices. Copying and installing Linux to a new device is much easier than copying a Tesla factory. That is why most top ten valued companies by market capitalization are software companies. There are no manufacturing companies to be found! Even though manufacturing cannot be scaled as well as software, how close can we make it if we tried? &lt;/p&gt;

    &lt;p&gt; To make the game even more stacked against manufacturing, computers are universal devices due to the Church-Turing thesis: any universal computer can do anything another universal computer can do. Analogously, imagine a factory; a universal factory that can make anything. That would be a very powerful device indeed. The process in building a universal factory is very hard compared to building a universal computer because the real world is messier than abstract mathematical objects like computable functions. Progress in using computers to design and make physical objects is being made via 3D printing, 4D printing, topological quantum computing; programmable matter in general. We don&apos;t know for sure what the first universal factory will look like. &lt;a href=&quot;#Nielsen&quot;&gt;(2)&lt;/a&gt;&lt;/p&gt;

    &lt;!-- &lt;h2&gt;Universal constructors and Universal assemblers&lt;/h2&gt; --&gt;

    &lt;p&gt;Von Neumann&apos;s universal factory is a machine that can create any other machine that can be programmed in its cellular automaton and described in a finite but arbitrarily long tape. Human beings have built a lot of amazing objects; pyramids, spaceships, superconductors e.t.c. It follows from this that a human being without free will and creativity (a human being without a mind) is a universal constructor. From this definition, Humans are more powerful than a universal factory because a machine that can build another machine from a program doesn&apos;t need to be creative to do it&apos;s job; it doesn&apos;t need to design the machine and write a program that builds it, it just executes the program it&apos;s given. &lt;a href=&quot;#Deutsch&quot;&gt;(3)&lt;/a&gt;

        &lt;p&gt; &lt;a href=&quot;https://www.fablabs.io/&quot;&gt;Fab Labs&lt;/a&gt; allow anyone to make (almost) anything. The (almost) hints that they are our next step to building a universal constructor. Assuming all the layouts of an official Fab Lab are the same, we can build robots that are specifically designed to navigate the Fab lab and place them in the lab. Robots that are as good as humans in vision smell, feel can be universal constructors because they can theoretically build anything humans can build given a program that describes what needs to be built. Humans can program the Fab lab by building something in it while The Fab Lab will record their movements. Once the object is built by humans, The Fab lab can make instructions from the recording and be able to clone the object that the human made. The only resources required from humans is the knowledge of how to build something and the raw materials required to build it.
        &lt;/p&gt;

        &lt;!-- &lt;h2&gt;Epilogue&lt;/h2&gt; --&gt;
        &lt;p&gt;It&apos;s a nightmare when technology goes out of control. A machine that decides it has no use for us is about as bad as it gets. Machines and humans should work together where humans come up with novel solutions to problems and machines solve those problems scalably. For this reason, it&apos;s better to invest in creating a universal constructor to augment our minds rather than an AGI to take over it.
        &lt;/p&gt;

        &lt;b&gt;Thanks&lt;/b&gt; to Zuriel Omole for reading drafts of this.

        &lt;p&gt;&lt;a href=&quot; https://www.reddit.com/user/vtomole/comments/eipxck/on_robots/&quot;&gt;Comments&lt;/a&gt;&lt;/p&gt;

        &lt;h2&gt;References&lt;/h2&gt;
        &lt;p&gt;
            &lt;a name=&quot;Niel&quot;&gt;&lt;/a&gt; (1) &lt;a href=&quot;http://cba.mit.edu/docs/papers/19.01.POW.pdf&quot;&gt;Digital Fabrication and the Future of Work&lt;/a&gt;, J. Cutcher-Gershenfeld, A. Gershenfeld, and N. Gershenfeld, Perspectives on Work, Labor and Employment Relations Association, pp. 8-13 (2018). &lt;/p&gt;
        &lt;p&gt;
            &lt;a name=&quot;Nielsen&quot;&gt;&lt;/a&gt; (2) Nielsen, Michael A. “&lt;a href=&quot; http://cognitivemedium.com/vme&quot;&gt;The varieties of material existence&lt;/a&gt;”, 2018.&lt;/p&gt;
        &lt;p&gt;
            &lt;a name=&quot;Deutsch&quot;&gt;&lt;/a&gt; (3) Deutsch, David (2012). &quot;Constructor Theory&quot;. &lt;a href=&quot;https://arxiv.org/abs/1210.7439&quot;&gt;1210.7439&lt;/a&gt; &lt;/p&gt;

&lt;/body&gt;

&lt;/html&gt;
&lt;section/&gt;
</content>
 </entry>
 
 <entry>
   <title>Fields and Quantum Error Correction</title>
   <link href="http://vtomole.com/blog/2019/07/29/field"/>
   <updated>2019-07-29T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2019/07/29/field</id>
   <content type="html">&lt;section&gt;
&lt;script type=&quot;text/x-mathjax-config&quot;&gt;
   MathJax.Hub.Config({tex2jax: {inlineMath: [[&apos;$&apos;,&apos;$&apos;], [&apos;\\(&apos;,&apos;\\)&apos;]]}});
&lt;/script&gt;
&lt;script src=&apos;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML&apos;&gt;&lt;/script&gt;
&lt;/script&gt;
&lt;script src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;
$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}|}$  
&lt;p&gt;A field is a set that has the following properties defined for addition and multiplication: 
   associativity, commutativity, distributivity, identity and an inverse.
   A finite field is a field with a finite number of elements. The finite field $\mathbb{F}_2$ is
&lt;/p&gt;
&lt;p&gt;$\begin{array}{|c|c|c|}
   \hline
   +&amp; 0 &amp; 1  \\ \hline
   0 &amp; 0 &amp; 1 \\ \hline
   1 &amp; 1 &amp; 0 \\ \hline
   \times &amp;  0 &amp; 1\\ \hline
   0&amp; 0 &amp; 1  \\ \hline
   1&amp; 0 &amp; 1  \\ \hline
   \end{array}$
&lt;/p&gt;
&lt;p&gt;This field is universal for classical computation because addition for the set $A = \{0, 1\}$ defines
   the AND gate and multiplication
   for $A$ defines the XOR gate; which can be used to construct the NAND gate by hard coding a 1
   on an input of the XOR gate to create the NOT gate. 
&lt;/p&gt;
&lt;p&gt;The Stabilizer gate set $S =\{CNOT, Hadamard, P\}$ where 
   P =  $\ket{0}$$\bra{0}$ + $i\ket{1}$$\bra{1}$  
   guarantees that if an n-qubit superposition is created between the basis states, those 
   basis states will be an affine subspace of $\mathbb{F}_{2^{n}}$ for an $n$-qubit system. Taking
   a one qubit system, the superpositons that can generated by the stabilizer set are 
   $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})$, 
   $\frac{1}{\sqrt{2}}(\ket{0} - \ket{1})$, $\frac{1}{\sqrt{2}}(\ket{0} + i\ket{1})$, and 
   $\frac{1}{\sqrt{2}}(\ket{0} - i\ket{1})$. The number of strings in the basis sets $\ket{0} + i\ket{1}$ 
   for example, is a power of two ( $2^{1}$); same for a 2 qubit system (e.t.c $\ket{00} + \ket{11}$). Since the stabilizer gate set and states are used
   to analyze quantum error correcting codes, this is an example of how finite fields are used in 
   &lt;a href = &quot;https://en.wikipedia.org/wiki/Coding_theory&quot;&gt;Coding theory&lt;/a&gt; and how some quantum error
   correcting codes can be efficiently simulated by classical computers.  
&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/17&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
   &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Field_(mathematics)&quot;&gt;Field (mathematics)&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href = &quot;https://www.scottaaronson.com/qclec/28.pdf&quot;&gt;Lecture 28, Tues May 2: Stabilizer Formalism (PDF)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Quantum scrambling and teleportation</title>
   <link href="http://vtomole.com/blog/2019/06/08/scrambling"/>
   <updated>2019-06-08T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2019/06/08/scrambling</id>
   <content type="html"> &lt;section&gt;
 &lt;script type=&quot;text/x-mathjax-config&quot;&gt;
  MathJax.Hub.Config({tex2jax: {inlineMath: [[&apos;$&apos;,&apos;$&apos;], [&apos;\\(&apos;,&apos;\\)&apos;]]}});
&lt;/script&gt;
&lt;script src=&apos;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML&apos;&gt;&lt;/script&gt;
&lt;/script&gt;
&lt;script src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;

$\newcommand{\ket}{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}}$
$\newcommand{\norm}[1]{\left\lVert#1\right\rVert}$
 
&lt;p&gt;Quantum information scrambling is when local information is thrown into a disorder throughout a quantum system. 
    This phenomena is similar to quantum decoherence where the information in a system is lost to the environment.
     Another way of viewing this incident is the qubits of the system entangle; and thus correlate to the qubits 
     in the environment. The problem is that quantum dechorence happens naturally to quantum computers since qubits can’t 
     be perfectly isolated from the environment. This makes an experiment that tests for quantum information scrambling 
     difficult because it seems like there is no way to distinguish if a system dispersed it’s information
      throughout itself or the environment without resorting to quantum state tomography; 
      which is intractable as the size of the quantum system grows. Fortunately, there is another way to differentiate
       between a quantum scrambled system and a quantum decohered one by means of quantum teleportation.&lt;/p&gt;

&lt;p&gt; &lt;a href = &quot;https://vtomole.github.io/blog/2018/11/23/basis&quot;&gt;Quantum teleportation &lt;/a&gt;
    is the problem of Alice needing to transport her state to Bob using classical 
    communication and an EPR pair shared by both parties. Unlike the standard quantum teleportation protocol where the 
    fidelity of sending the unknown quantum state is 100%. The protocol talked about here is probabilistic. First, 
    we define the many-body-system by creating 3 EPR pairs, then we apply $U$ to half of the system and $U^\dagger$ to the other
    half where $U$ (a unitary that delocalizes all single qubit operators into three-qubit operators) performs the scrambling.
    Since Alice&apos;s quantum state is fully scrambled in the system, Bob can sucessfully decode it by making a Bell measurement of any pair
    of qubits. &lt;p&gt;

&lt;p&gt;The quantum circuit and program that defines the many-body-system, Alice&apos;s state, the scrambling of Alice&apos;s state and 
    it&apos;s decoding by Bob is displayed below. 
    The success of this prototcol is usually around 50%.
&lt;/p&gt;
&lt;pre&gt;
0: ---X----------@----------@---H-------@---@-------------------
                 |          |           |   |
1: ---H-----@----|----------@---@---H---|---@---@---@---H---M---
            |    |              |       |       |   |
2: ---H----@|----@--------------@---H---@-------@---X---M-------
           ||
3: --------X|----@--------------@---H---@-------@---------------
            |    |              |       |       |
4: ---------X----|----------@---@---H---|---@---@---------------
                 |          |           |   |
5: ---H----@-----@----------@---H-------@---@-------------------
           |
6: --------X-----M(&apos;bob&apos;)---------------------------------------
&lt;/pre&gt;

&lt;pre class=&quot;prettyprint lang-python&quot;&gt;
&quot;&quot;&quot;To demonstrate quantum scrambling using teleportation without Grover search&quot;&quot;&quot;
import numpy as np
import cirq

def bell_basis_measurement(first_qubit, second_qubit):
    circuit = cirq.Circuit()
    circuit.append([
        cirq.CNOT(first_qubit, second_qubit),
        cirq.H(first_qubit),
        cirq.measure(first_qubit), 
        cirq.measure(second_qubit),   
    ])
    return circuit

def scrambling_circuit(q0, q1, q2, q3, q4, q5):
    circuit = cirq.Circuit()
    
    circuit.append([
        # Define U
        cirq.CZ(q0, q2),
        cirq.CZ(q0, q1),
        cirq.CZ(q1, q2),
        cirq.H(q0),
        cirq.H(q1),
        cirq.H(q2),
        cirq.CZ(q0, q2),
        cirq.CZ(q0, q1),
        cirq.CZ(q1, q2),

        # Define conjugate of U
        cirq.CZ(q3, q5),
        cirq.CZ(q4, q5),
        cirq.CZ(q3, q4),
        cirq.H(q3),
        cirq.H(q4),
        cirq.H(q5),
        cirq.CZ(q3, q5),
        cirq.CZ(q4, q5),
        cirq.CZ(q3, q4),
    ])

    return circuit


def scrambling_teleportation(circuit, qubits_to_measure):
    &quot;&quot;&quot;
    Output exmple: Fidelity 48/100
    &quot;&quot;&quot;
    repetitions = 100

    # Prepare the state to be |1&gt;   
    circuit.append([
        cirq.X(q0),
    ])

    # Defining many-body-system
    circuit.append([
        cirq.H(q1),
        cirq.H(q2),
        cirq.H(q5),
        cirq.CNOT(q5, q6),
        cirq.CNOT(q2, q3),
        cirq.CNOT(q1, q4),    
    ])

    # Retrieving U and and conjugate of U on the subsystems
    scrambling_unitary = scrambling_circuit(q0, q1, q2, q3, q4, q5)

    circuit.append([
        scrambling_unitary,
        bell_basis_measurement(qubits_to_measure[0], qubits_to_measure[1]), 
        cirq.measure(q6, key=&apos;bob&apos;)
    ])
   
    results = cirq.Simulator().run(circuit, repetitions=repetitions)
    bob_measurement = np.array(results.measurements[&apos;bob&apos;][:, 0])
    print(&quot;Fidelity {}/{}&quot;.format(sum(bob_measurement), repetitions))
    
   


if __name__ == &apos;__main__&apos;:
    q0, q1, q2, q3, q4, q5, q6 = cirq.LineQubit.range(7)
    circuit = cirq.Circuit()
    # Any Bell Pair measurement should give the same fidelities (aound 50%)
    scrambling_teleportation(circuit, qubits_to_measure=[q1, q2])
    &lt;/pre&gt;
 &lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/16&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

  &lt;h2&gt;Reference&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href = &quot;https://arxiv.org/abs/1806.02807&quot;&gt;Verified Quantum Information Scrambling&lt;/a&gt;&lt;/li&gt;
  
&lt;/ul&gt;
&lt;section/&gt;
</content>
 </entry>
 
 <entry>
   <title>Hamiltonian simulation and Trotterization</title>
   <link href="http://vtomole.com/blog/2019/04/07/trotter"/>
   <updated>2019-04-07T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2019/04/07/trotter</id>
   <content type="html"> &lt;section&gt;
 &lt;script type=&quot;text/x-mathjax-config&quot;&gt;
  MathJax.Hub.Config({tex2jax: {inlineMath: [[&apos;$&apos;,&apos;$&apos;], [&apos;\\(&apos;,&apos;\\)&apos;]]}});
&lt;/script&gt;
&lt;script src=&apos;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML&apos;&gt;&lt;/script&gt;
&lt;/script&gt;
&lt;script src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;

$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}|}$
$\newcommand{\norm}[1]{\left\lVert#1\right\rVert}$
 

&lt;p&gt;The evolution of a quantum system is governed by the Schrödinger equation $i \dfrac{d\ket{\psi(t)}}{dt} = H \ket{\psi(t)}$. The solution of the Schrödinger equation ($\ket{\psi(t)} = e^{-iHt}\ket{0}$) is a description on what state a system will be in after a hamiltonian has been applied to it for a certain period of time. The problem of Hamiltonian simulation is thus stated as follows: Given a Hamiltonian $H$ and an evolution time $t$, output a sequence of computational gates that implement $U=e^{-iHt}$. This problem is meaningful because simulating the dynamics of a quantum system is an essential problem in quantum physics and quantum chemistry. It&apos;s widely believed that the Hamiltonian simulation problem can be solved with an exponential number of gates on a classical computer while requiring only a polynomial number on a quantum computer. &lt;/p&gt;

&lt;p&gt; Hamiltonians are hermitian operators that are usually a sum of a large number of individual hamiltonians $H_{j}$. For example, a Hamiltonian $H$ can be equal to $ H_{1} + H_{2}$. This sum of 2 hamiltonians can be described by the Lie product formula: $e^{-i(H_1+H_2)t} = \lim_{N \rightarrow \infty} (e^{-iH_1t/N}e^{-iH_2t/N})^N$. Since the limit of this formula is infinite, we have to truncate the series when implementing this formula on a quantum computer. The truncation introduces error in the simulation that we can bound by a maximum simulation error $\epsilon$ such that $\norm{ e^{-i H t} - U} \leq \epsilon$. This truncation is known as Trotterization and it&apos;s widely used to simulate non-commuting hamiltonians on quantum computers. The Trotterization formula is then $e^{-iHt} = (e^{-iH_{0}t/r} * e^{-iH_{1}t/r ....* e^{-iH_{d-1}}t/r })^r$ + $0$(some polynomial factors).&lt;/p&gt;


  &lt;p&gt;Suppose we want to simulate $H = X_{0} + Z_{0}$ where X and Z are Pauli matrices and the 
    subscripts label the qubits that the hamiltonians apply to. 
    We can&apos;t simulate each Hamiltonian separately because X and Z Paulis don&apos;t commute. 
    This is why we use Trotterization where we evolve the whole hamiltonian by 
    repeatedly switching between evolving $X_{0}$ and $Z_{0}$ each for a small period of time. 
    The first step in deriving the circuit that will simulate this hamiltonian is finding the
     quantum gates that implement each of it&apos;s individual term. 
     This case is simple since the quantum gates $R_{x}(\theta) = e^{-i \dfrac{\theta}{2}X}$ and 
     $R_{z}(\theta) = e^{-i \dfrac{\theta}{2}Z}$ will implement the individual terms perfectly. 
     $\theta$ specifies the angle by which to rotate the state in a specified axis; 
     this is sort of synonymous with time since it specifies how &quot;long&quot; to apply the hamiltonian 
     to the qubit ($\pi/2$ degrees could take 30 nanoseconds to rotate to, $\pi$ degrees 
     could take 60 nanoseconds, e.t.c). 
     Since we don&apos;t care too much about the simulation error in this example, 
     we will use $r = 2$ and $t=1$ in our Trotter formula to get 
     $e^{X_{0} + Z_{0}} = (e^{-iX_{0}} * e^{-iZ_{0}}) * (e^{-iX_{0}/2} * e^{-iZ_{0}/2}) $.    &lt;p&gt;
 &lt;p&gt; Discuss on &lt;a href = &quot;https://www.reddit.com/user/vtomole/comments/ff0iwj/hamiltonian_simulation_and_trotterization/&quot;&gt;Reddit&lt;/a&gt;.&lt;/p&gt;

  &lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href = &quot;https://arxiv.org/abs/1904.01131&quot;&gt;Q# and NWChem: Tools for Scalable Quantum Chemistry on Quantum Computers&lt;/a&gt;&lt;/li&gt;
  
&lt;/ul&gt;
&lt;section/&gt;
</content>
 </entry>
 
 <entry>
   <title>Quantum Teleportation and Basis Measurements</title>
   <link href="http://vtomole.com/blog/2018/11/23/basis"/>
   <updated>2018-11-23T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/11/23/basis</id>
   <content type="html"> &lt;section&gt;
 &lt;script type=&quot;text/x-mathjax-config&quot;&gt;
  MathJax.Hub.Config({tex2jax: {inlineMath: [[&apos;$&apos;,&apos;$&apos;], [&apos;\\(&apos;,&apos;\\)&apos;]]}});
&lt;/script&gt;
&lt;script src=&apos;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML&apos;&gt;&lt;/script&gt;
&lt;/script&gt;
&lt;script src=&quot;https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js&quot;&gt;&lt;/script&gt;

$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}|}$
 

&lt;p&gt;It&apos;s easy to be confused on what &quot;measuring on a basis&quot; means; especially if one is not familiar with Linear Algebra. Measuring on a basis is measuring the state $\ket{\psi}$ = $\alpha \ket{\upsilon  }$ +  $\beta \ket{\omega }$  where $\ket{\psi}$ is expressed in terms of the basis $\left\{ \ket{\upsilon  }, \ket{\omega } \right\}$. Measurements are represented by a set of operators $P_i$ satisfying $\sum_{i}^{} P_i =  \mathbb{I}$. This means that measurement on a basis  $\left\{ \ket{\upsilon  }, \ket{\omega } \right\}$ is defined as the operators  $P_{\upsilon}$ = $\ket{\upsilon} \bra{\upsilon}$, $P_{\omega}$ = $\ket{\omega} \bra{\omega}$. When $\ket{\psi}$ is measured, it&apos;s outcome is $i$ with probability $p_i$ = $\bra{\psi} P_i \ket{\psi}$. Measurement in the standard basis $\left\{ \ket{0}, \ket{1} \right\}$ is then $P_0$ = $\ket{0} \bra{0}$, $P_1$ = $\ket{1} \bra{1}$.  This makes $p_0$ = ($\alpha \bra{0 }$ +  $\beta \bra{1}$) *  ($\ket{0} \bra{0}$) * ($\alpha \ket{0 }$ +  $\beta \ket{1}$) =  ${\mid {\alpha} \mid}^2$. &lt;/p&gt;

&lt;p&gt;Measurements can be done on any orthornormal basis where  $\ket{\upsilon  }$ is measured with probability ${\mid {\alpha} \mid}^2$ and  $\ket{\omega  }$ is measured with probability  ${\mid {\beta} \mid}^2$. Since qubits have the states  $\left\{ \ket{0}, \ket{1} \right\}$, a method for performing measurements in a basis through the quantum circuit model where $\ket{0}$ represents $\ket{\upsilon}$ and $\ket{1}$ represents $\ket{\omega}$ is done with a unitary gate corresponding to the appropriate basis change followed by a measurement operator in the standard basis. &lt;p&gt;

&lt;p&gt; In the quantum teleportation protocol, two parties Alice and Bob share an EPR pair $\frac{1}{\sqrt{2}} \ket{00} + \frac{1}{\sqrt{2}} \ket{11} $. If these parties are separated, the measurements on their respective qubits will be correlated. If Alice has another qubit in the state  $\ket{\psi}$ = $\alpha \ket{0}$ +  $\beta \ket{1}$ and she wants to give it to Bob, she can do it using her half of the EPR pair and classical communication. Alice will perform a Bell Basis measurement on her EPR qubit with the quantum state she wants to transmit to Bob. Remember, a quantum gate followed by a measurement in the computational basis is a measurement in a different basis; so a  Bell Basis measurement will be a CNOT gate from the unknown quantum state to Alice&apos;s EPR pair followed by a Hadamard gate to the unknown quantum state. This is a Bell Basis measurement because the Bell state is prepared by applying a Hadamard gate on the first qubit followed by a CNOT gate from the first to the second qubit. Alice will then send the results of her Bell Basis measurements to Bob via 2 bits. Bob will perform operations on his half of the EPR pair based on the bits he receives from Alice to get the state that Alice wants to teleport to him. If he recieves $\ket{00}$, he will apply the identity gate. If he receives $\ket{01}$, he will apply the X gate, if he receives $\ket{10}$, he will apply the Z gate, and if he recieves $\ket{11}$, he will apply both the X and Z gates. &lt;/p&gt;

&lt;p&gt; If Alice wants to teleport $\ket{1}$ to Bob, she can do so with the following procedure: &lt;/p&gt;

&lt;pre&gt;
  (0, 0):------X-----------@----H----M(&apos;s&apos;)-----@--------------
                           |                    |
  (0, 1): ------H------@---X---------M(&apos;a&apos;)--@--|---------------
                       |                     |  |
  (0, 2): -------------X---------------------X -@ -----M(&apos;b&apos;)---
&lt;/pre&gt;
The following is a program that represents the corresponding circuit:
  &lt;pre class=&quot;prettyprint lang-python&quot;&gt;
&quot;&quot;&quot;To demonstrate teleportation on a NISQ machine &quot;&quot;&quot;
import numpy as np
import cirq

def main():
    &quot;&quot;&quot;
    Output: The result of measuring Bob&apos;s qubit [True]
    &quot;&quot;&quot;
    state = cirq.GridQubit(0, 0)
    alice = cirq.GridQubit(0, 1)
    bob = cirq.GridQubit(0, 2)
    circuit = cirq.Circuit()
    
    # Prepare the state to be |1&gt;   
    circuit.append([
        cirq.X(state),
    ])

    # Prepare shared entangled state.
    circuit.append([
        cirq.H(alice),
        cirq.CNOT(alice, bob),
    ])
    
    # Bell Basis measurement on state and Alice&apos;s qubit
    circuit.append([
        cirq.CNOT(state, alice),
        cirq.H(state),
        cirq.measure(state, key=&apos;s&apos;),
        cirq.measure(alice, key=&apos;a&apos;),
    
    ])
    
    # Classical communication. This simulates Bob applying
    # operations on his qubit based on the bits he receives from Alice
    circuit.append([cirq.CNOT(alice, bob),
                    cirq.CZ(state, bob),
    ])
    
    circuit.append([cirq.measure(bob, key=&apos;b&apos;)])
    result = cirq.google.XmonSimulator().run(circuit)
    bob_measurement = np.array(result.measurements[&apos;b&apos;][:, 0])

    print(&quot;The result of measuring Bob&apos;s qubit &quot;, bob_measurement)


if __name__ == &apos;__main__&apos;:
        main()


&lt;/pre&gt;
  

  &lt;/p&gt;
&lt;section/&gt;
&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/15&quot;&gt;Github&lt;/a&gt;&lt;/p&gt; 
  &lt;section/&gt;

  


  &lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href = &quot;https://www.cs.cmu.edu/~odonnell/quantum15/lecture03.pdf&quot;&gt;Lecture 3: The Power of Entanglement&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;section/&gt;
</content>
 </entry>
 
 <entry>
   <title>Quantum Phase Estimation and Hadamard test</title>
   <link href="http://vtomole.com/blog/2018/05/20/pea"/>
   <updated>2018-05-20T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/05/20/pea</id>
   <content type="html">  &lt;section&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Quantum Phase estimation is an important subroutine in quantum computing. It’s used for factoring, quantum simulation, and discrete logarithm. A version of Phase estimation called the Hadamard test is used to approximate the Jones polynomial (a significant expression in &lt;a href = &quot;https://en.wikipedia.org/wiki/Knot_theory&quot;&gt;Knot theory&lt;/a&gt;). Quantum computers can estimate phases more efficiently than classical computers because quantum computers can exploit the Quantum Fourier transform; which requires $O(n^2)$ gates instead of $O(n*2^n)$ on classical computers. This post will cover Phase Estimation and Hadamard test including their implementations on a quantum computer.&lt;/p&gt; 
&lt;section/&gt;

  &lt;section/&gt;

   
&lt;h2&gt;Quantum Phase estimation&lt;/h2&gt;
$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
$\newcommand\bra[1]{\langle{#1}|}$

&lt;p&gt;Quantum Phase estimation solves: Given a Unitary $\textit{U}$ and an eigenvector of  $\textit{U}$ $\ket{\psi}$ such that $U\ket{\psi}$ = $e^{2 \pi i  \theta}$ where $0 \leq \theta &lt; 1$, find the eigenvalue $e^{2 \pi i  \theta}$ of $\ket{\psi}$ or the phase $\theta$. &lt;/p&gt;


&lt;p&gt; This algorithm uses 2 registers. The first register contains $m$ qubits. The more $m$ qubits, the more accurate $\theta$&apos;s estimation will be.  The second register contains $\ket{\psi}$. Quantum Phase estimation first prepares the state $\ket{0}_{m} \ket{\psi}$ by intilizing the first $m$ qubits to $\ket{0}$ and encoding $\ket{\psi}$ in the second register. Hadamard gates are applied to each qubit in the first register&lt;/p&gt;
															 
															   \[ \ket{\varphi_{0}} = H^{\otimes m} [\ket{0}] \ket{\psi} =  \frac{1}{\sqrt{2^m}}[(\ket{0} + \ket{1})_{0} \, (\ket{0} + \ket{1})_{1} \, (\ket{0} + \ket{1})_{2}\, ... (\ket{0} + \ket{1})_{2^m-1}] \ket{\psi} \]

																		&lt;p&gt;$2^{m-1}$ controlled-U (cU) gates are applied to the second register, remember that $U \ket{\psi}$ = $e^{2 \pi i  \theta}$&lt;/p&gt;


															   \[ \ket{\varphi_{1}} = cU^{2m-1}  \ket{\varphi_{0}} =  \frac{1}{\sqrt{2^m}}[(\ket{0} + e^{2 \pi i  \theta 2^{0}} \ket{1})_{0} \, (\ket{0} + e^{2 \pi i  \theta} 2^{1} \ket{1})_{1} \, (\ket{0} + e^{2 \pi i  \theta} 2^{2} \ket{1})_{2}\, ... (\ket{0} + e^{2 \pi i  \theta 2^{m-1}}  \ket{1})_{2^m-1}] \ket{\psi} \]

															   &lt;p&gt;This equation can be written as&lt;/p&gt; 
															   \[ \ket{\varphi_{1}} = \frac{1}{\sqrt{2^m}} [ \sum_{k=0}^{ 2^{m-1}}  e^{2 \pi i  \theta k} \ket{k}] \ket{\psi}   \]

&lt;p&gt;Which is similiar to the Quantum Fourier transform&lt;/p&gt; 															   
\[\text{QFT} \ket{x} = \frac{1}{\sqrt{2^m}} \sum_{k=0}^{ 2^{m-1}}  e^{\frac{2 \pi i x k}{2^n}}  \ket{k}  \]

															   &lt;p&gt;The first register of $\ket{\varphi_{1}}$ is similar to QFT $\ket{x}$ (QFT $\ket{\theta}$). To get $\ket{\theta}$, the inverse of the Quantum Fourier transform (QFT in reverse) is applied to the first register.&lt;/p&gt; 

														\begin{align}\text{QFT}^{-1} \text{QFT} \ket{\theta} = \text{QFT}^{-1} \frac{1}{\sqrt{2^m}} \sum_{k=0}^{ 2^{m-1}}  e^{2 \pi i  \theta k} \ket{k} = \ket{\theta_{0} \, \theta_{1} \,  \theta_{2} ... \, \theta_{m}  }    \end{align}

																		&lt;p&gt;The state of the second register doesn&apos;t change during computation, so the final state of the system before measurement is $\ket{\theta_{0} \, \theta_{1} \,  \theta_{2} ... \, \theta_{m}   }	\ket{\psi} $. Measurement of the first register will result in an approximation of $\theta$.&lt;/p&gt;

																		&lt;h3&gt;Quantum Phase estimation example&lt;/h3&gt;
																		&lt;p&gt;Given a unitary 
$U = \begin{bmatrix}
    0 &amp; 1 \\
    1 &amp; 0 \\
																		  \end{bmatrix} $, and an eigenvector of $U$ (1, 1), with an eigenvalue of $\lambda = e^{2 \pi i  \theta}$, find the phase ($\theta$). A calculation for the eigenvalues of U gives $\lambda_{1} = 1$ and $\lambda_{2} = -1$. So $\theta_{1} = 0$ and $\theta_{2} = \frac{1}{2}$. The phases can be calculated on a quantum computer where $\theta_{1}$ corresponds to the measured result  $0$ and $\theta_{2}$ to $1$ because it&apos;s the only other option (using more qubits to estimate  $\frac{1}{2}$ is not neccesary in this case).&lt;/p&gt;

																		  &lt;p&gt;The eigenvalue can be approximated wih a single bit, so the first register will contain a qubit. The second register will also contain one qubit because $U$ is a one qubit gate (i.e X gate). To encode the eigenvector (1,1) into the second register, it has to be nomalized to $(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$. The Hadamard gate is applied to the first qubit resulting in $\frac{1}{\sqrt{2}}[(\ket{0} + \ket{1}$. The normalized eigenvector $\ket{\psi}$ is encoded using the Hadamard gate. The state of the system is &lt;/p&gt; 

																		  \[  \frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) \frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) = \frac{1}{\sqrt{2}} (\ket{0} \ket{0} + \ket{1} \ket{1})  \]

																		  &lt;p&gt;Applying the cU gate&lt;/p&gt;
																		  

																		  \[cU [\frac{1}{\sqrt{2}} (\ket{0} \ket{0} + \ket{1} \ket{1})] = \frac{1}{\sqrt{2}} (\ket{0} \ket{0} + U \ket{1} \ket{1}) =  \frac{1}{\sqrt{2}}(\ket{0} + U \ket{1}) \frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) = \frac{1}{\sqrt{2}}(\ket{0} +  e^{2 \pi i  0} \ket{1}) \frac{1}{\sqrt{2}}(\ket{0} + \ket{1})   \]

																		  &lt;p&gt;The inverse QFT of this equation is calculated by applying the Hadamard gate to the first qubit.&lt;/p&gt;

																		  \[ H [\frac{1}{\sqrt{2}}(\ket{0} +  e^{2 \pi i  0} \ket{1})] \frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) = \ket{0} \frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) \]

																		  &lt;p&gt;Measuring the first qubit gives $0$ as predicted by theory.&lt;/p&gt;
																		   &lt;h3&gt;Phase estimation implementation on a Quantum computer&lt;/h3&gt;

																		  &lt;pre&gt;
  &lt;code&gt;
phase_estimation_0 = Program(
    H(0),
    H(1),
    CNOT(0, 1), #CNOT is another name for cX which is cU in this example
    H(0),
)
print(&quot;Expected answer is 0&quot;)
result = qvm.run_and_measure(phase_estimation_0, [0], 1)
print(result)
 
&lt;/code&gt;
																		  &lt;/pre&gt;
																		  
    
																		  &lt;p&gt;To estimate $\theta_{2}$, another eigenvector of $U$ (-1, 1) normalized to $(-\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})$ will be loaded into the second register. This is accomplished by the the Hadamard gate followed by the Z gate&lt;/p&gt;
																		  \[ZH\ket{0} = \frac{1}{\sqrt{2}}(-\ket{0} + \ket{1})\]
																		  &lt;p&gt;The remaining instructions for this program will be the same as the previous one.Quick calculations will show that the first register contains $\ket{\frac{1}{2}}$.&lt;/p&gt;
																		  &lt;pre&gt;
  &lt;code&gt;
phase_estimation_1 = Program(
    H(0),
    Z(0),
    H(1),
    CNOT(0, 1), #CNOT is another name for CX which is CU in this example
    H(0),
)
print(&quot;Expected answer is 1&quot;)
result = qvm.run_and_measure(phase_estimation_1, [0], 1)
print(result)
 
&lt;/code&gt;
																		  &lt;/pre&gt;



																		  

																		   &lt;p&gt;These programs are implemented &lt;a href = &quot;https://github.com/QCHackers/qchackers/blob/master/pyquil/phase_estimation.py&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

  &lt;/section&gt;

   &lt;h2&gt;Hadamard Test&lt;/h2&gt;
  &lt;p&gt;The Hadamard test solves: Given a Unitary $U$ and a state $\ket{\psi}$, estimate $\bra{\psi} | U \ket{\psi}$. It prepares the state  $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) \ket{\psi}$ by appplying the hadamard gate to the first qubit,  applies cU from  $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})$ to $\ket{\psi} $ to get   $\frac{1}{\sqrt{2}}(\ket{0} \ket{\psi} + \ket{1} U \ket{\psi})$. After the Hadamard gate is applied to the first qubit again, the probability of measuring $\ket{0}$ is \[\frac{1}{2} (1 + \text{Re} \bra{\psi} U \ket{\psi}) \] The probability of measuring $\ket{1}$ is

    \[\frac{1}{2} (1 - \text{Re} \bra{\psi} U \ket{\psi})\]

    The result we want to approximate is calculated by subtracting probabilities
    \[ \text{Re} \bra{\psi} U \ket{\psi} = \frac{1}{2} (1 + \text{Re} \bra{\psi} U \ket{\psi}) - \frac{1}{2} (1 - \text{Re} \bra{\psi} U \ket{\psi}) \]


    where $\text{Re} \bra{\psi} U \ket{\psi}$ is the real component of $\bra{\psi} U \ket{\psi}$. $\text{Im} \bra{\psi} | U \ket{\psi}$ is estimated by first preparing the state $\frac{1}{\sqrt{2}}(\ket{0} + i \ket{1})$ instead of $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})$.  This is prepared by applying the Hadamard gate followed by the S gate. The steps involved in deriving expected values are &lt;a href = &quot;https://en.wikipedia.org/wiki/Hadamard_test_(quantum_computation)&quot;&gt;here&lt;/a&gt; &lt;/p&gt;

  &lt;h3&gt;Hadamard test example&lt;/h3&gt;
  &lt;p&gt;Given a unitary 
$U = \begin{bmatrix}
    0 &amp; 1 \\
    1 &amp; 0 \\
    \end{bmatrix} $, and a state $\ket{1}$, estimate $\bra{1} | U \ket{1}$. $\bra{1} U \ket{1}$ = $\bra{1}\ket{0} = 0$.&lt;/p&gt;

  &lt;p&gt; Encoding $\ket{1}$ is fulfilled by applying the X gate on the second qubit.
    $\ket{0} \text{X}(\ket{0}) = \ket{0} \ket{1}$. The Hadamard gate is applied to the first qubit  $H (\ket{0}) \ket{1}$ =  $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) \ket{1}$. Applying CU to the system
    \[CU [\frac{1}{\sqrt{2}}(\ket{0} + \ket{1}) \ket{1}] = \frac{1}{\sqrt{2}}(\ket{0} \ket{1} +  \ket{1} U \ket{1}) = \frac{1}{\sqrt{2}}(\ket{0} \ket{1} +  \ket{1} \ket{0})  \]

    Applying Hadamard to the first qubit results in:
    \[ H \otimes I (\frac{1}{\sqrt{2}}(\ket{0} \ket{1} +  \ket{1} \ket{0})) = \frac{1}{2}\ket{00} + \frac{1}{2}\ket{01} - \frac{1}{2}\ket{10} + \frac{1}{2}\ket{11} \]

    This means that there is a 0.25 probability qubit 1 is 0 and 0.25 that it&apos;s 1 upon measurement. 0.25 - 0.25 = 0, the expected value.
    

&lt;h3&gt;Hadamard test implementation on a Quantum computer&lt;/h3&gt;
     &lt;pre&gt;
  &lt;code&gt;
 hadamard_test0 = Program(
    X(0),
    H(0),
    CNOT(0, 1),
    H(0),
)
print(&quot;Expected value will be closer to 0 than 100 or -100&quot;)
result = qvm.run_and_measure(hadamard_test0, [0], 100)
print(get_Re(result))
 
  &lt;/code&gt;
     &lt;/pre&gt;
     &lt;p&gt;The Hadamard test is probabilistic. It will give an expectation value that is close to 0 as is predicted by theory.&lt;/p&gt;
      &lt;p&gt;What if $\ket{\psi}$ is $\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})$ instead of $\ket{0}$? $\bra{\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})} U \ket{\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})} = \bra{\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})}  \ket{\frac{1}{\sqrt{2}}(\ket{0} + \ket{1})} = 1 $. Executing this program on a quantum computer shows that the answer is 1.&lt;/p&gt;
   &lt;pre&gt;
     &lt;code&gt;

 hadamard_test1 = Program(
    H(1),
    H(0),
    CNOT(0, 1),
    H(0),
)

print(&quot;Expected value will 1&quot;)
result = qvm.run_and_measure(hadamard_test1, [0], 1)
print(get_Re(result))
  &lt;/code&gt;
   &lt;/pre&gt;
   
&lt;p&gt;Implementations of these Hadamard tests are &lt;a href = &quot;https://github.com/QCHackers/qchackers/blob/master/pyquil/hadamard_test.py&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
  

				    
				    
   &lt;/section&gt;


   &lt;section&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Finding the eigenvalues of an operator is an important problem in Linear algebra. Quantum Phase Estimation and it&apos;s cousin the Hadamard test are important subroutines for quantum algorithms that leverage the Quantum fourier transform to perform operations more efficiently on quantum computers than classical computers. Phase estimation can be used in quantum simulation and factoring. The Hadamard test is used to solve the Jones polynomial; which is important in knot and topological quantum field theories. This post covered examples of how the Hadamard test and Phase Estimation algorithm work.&lt;/p&gt;
&lt;section/&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/14&quot;&gt;Github&lt;/a&gt;&lt;/p&gt; 
 &lt;section&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Hadamard_test_(quantum_computation)&quot;&gt;Wikipedia entry on Hadamard Test&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Quantum_phase_estimation_algorithm&quot;&gt;Wikipedia entry on Quantum phase estimation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Quantum_Fourier_transform&quot;&gt;Wikipedia entry on Quantum Fourier transform&lt;/a&gt;&lt;/li&gt; 
  
&lt;/ul&gt;
&lt;section/&gt;
</content>
 </entry>
 
 <entry>
   <title>Quantum programming at Hack ISU</title>
   <link href="http://vtomole.com/blog/2018/03/29/qchackisu"/>
   <updated>2018-03-29T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/03/29/qchackisu</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Qchackers built an &lt;a href=&quot;http://qchackers.com&quot;&gt;SDK for quantum computers&lt;/a&gt; at Hack ISU last weekend. Evan Anderson,  Dylan Sharp and I created a compiler and quantum virtual machine (QVM); which were used to demonstrated quantum teleportation between two QVMs.  We received the &lt;a href=&quot;https://twitter.com/MLHacks/status/977959734467858433&quot;&gt;AWS Education prize&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compiler and QVM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The compiler was written in Common Lisp.  I tried to write the compiler in Python, but Python did not have all the features I needed; like generating and executing code on the fly. Even though Common Lisp made deploying our SDK to the cloud difficult, it was a good trade off because a Common Lisp implementation of the compiler is easier to extend than a Python implementation.&lt;/p&gt;

&lt;p&gt;The QVM was implemented in Python with Numpy. Implementing the virtual machine was straightforward. The most difficult part was debugging. Our virtual machine executes basic single and two qubit gates.  It also performs measurements on the qubits. Measurement results can be stored in a classical register via a classical instruction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quantum teleportation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hack ISU was the first time Dylan studied quantum computation. His task was to grok quantum teleportation and figure out how to implement it across two QVMs. Dylan went through all the highs and lows of studying quantum computation in a relatively short period of time. He went from reviewing linear algebra to understanding quantum teleportation in 24 hours. Dylan corresponded with Evan in implementing quantum teleportation on the QVMs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hack ISU Spring 2018 was my most productive hackathons. I was lucky to work with someone who knew quantum computing, and another who was eager learn. Without Dylan’s newfound knowledge of quantum teleportation and Evan’s expertise in Python programming and web development, we wouldn’t have accomplished as much as we did. I would definitely hack with this group of Qchackers again!&lt;/p&gt;

&lt;p&gt;Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/issues/13&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Quantum entanglement and Superdense coding</title>
   <link href="http://vtomole.com/blog/2018/03/03/sd"/>
   <updated>2018-03-03T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/03/03/sd</id>
   <content type="html">  &lt;section&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Quantum entanglement is a powerful physical phenomenon where quantum systems interact in a way that they can&apos;t be described independently of each other. This anomaly is useful for sending classical information. Superdense coding is a procedure where quantum superposition and entanglement is used to encode two bits of information in one quantum bit. This blog post covers the basics of quantum systems and the mathematical methods used to describe and manipulate them. This post also shows how superdense coding is used to encode and decode bits 01, followed by the execution of a superdense code on a Quantum Virtual Machine (QVM).&lt;/p&gt; 
&lt;section/&gt;

  &lt;section&gt;
    $\newcommand{\ket}[1]{\left|{#1}\right\rangle}$
    
    &lt;h2&gt;Simple Quantum Systems&lt;/h2&gt;
&lt;p&gt;The pure state of a two-level quantum system (qubit) is represented by a $2\times1$ matrix
\begin{align}
\ket{\psi} = \begin{bmatrix}
    \alpha \\
    \beta \\
    \end{bmatrix} = \alpha \ket{0} + \beta \ket{1}
    \end{align}

Where $\alpha$ and $\beta$ are complex numbers that represent probability amplitudes and $${|\alpha|}^2 + {|\beta|}^2 =1$$



     The spin of an electron is a two-level quantum system where
    \begin{align}
\ket{0} = \begin{bmatrix}
    1 \\
    0 \\
    \end{bmatrix}
     \end{align}

is spin down and
\begin{align}
\ket{1} = \begin{bmatrix}
    0 \\
    1 \\
    \end{bmatrix}
    \end{align}

    is spin up.$\\$&lt;/p&gt;
    &lt;section/&gt;

    &lt;section&gt;
&lt;h2&gt;Operators&lt;/h2&gt;
&lt;p&gt;The state of a quantum system is modfied by applying an operator $\textit{U}$ to it. $\textit{U}$ could be a Pauli-X matrix,
\begin{align}
X &amp;= \begin{bmatrix}
    0 &amp; 1 \\
    1 &amp; 0 \\
\end{bmatrix}
  \end{align}

  or a Pauli-Z matrix.
  
\begin{align}
Z &amp;= \begin{bmatrix}
    1 &amp; 0 \\
    0 &amp; -1 \\
\end{bmatrix}
  \end{align}
  
  It can also be an identity matrix, whose application does not change the system&apos;s state.
  \begin{align}
I &amp;= \begin{bmatrix}
    1 &amp; 0 \\
    0 &amp; 1 \\
\end{bmatrix}
  \end{align}
  
Operator application is realized by computing the dot product of the operator and the state. The Pauli-X operator modifies the spin of an electron from up to down and vice versa.

\begin{align}
  \begin{bmatrix}
    0 &amp; 1 \\
  1 &amp; 0 \\
  \end{bmatrix} . \begin{bmatrix}
    1  \\
    0  \\
\end{bmatrix}
 = \begin{bmatrix}
    0 \\
    1 \\
\end{bmatrix}
\end{align}

     The Hadamard operator
    \begin{align}
    H &amp;= \frac{1}{\sqrt{2}} \begin{bmatrix}
    1 &amp; 1 \\
    1 &amp; -1 \\
\end{bmatrix} 
\end{align}
    puts an electron in an equal superposition of spin up and spin down.
    \begin{align}
  \frac{1}{\sqrt{2}} \begin{bmatrix}
    1 &amp; 1 \\
    1 &amp; -1 \\
  \end{bmatrix} .
  \begin{bmatrix}
    1  \\
    0  \\
\end{bmatrix} 
= \begin{bmatrix}
    \frac{1}{\sqrt{2}}  \\
    \frac{1}{\sqrt{2}} \\
\end{bmatrix} = \frac{1}{\sqrt{2}} \ket{0} + \frac{1}{\sqrt{2}} \ket{1}
\end{align}

When this state is measured, there is a ${|\frac{1}{\sqrt{2}}|}^2 = 0.5$ chance that it will be $\ket{0}$ and ${|\frac{1}{\sqrt{2}}|}^2 = 0.5$ chance that it will be $\ket{1}.$&lt;/p&gt;
  &lt;/section&gt;



  &lt;section&gt;
  &lt;h2&gt;Quantum Entanglement&lt;/h2&gt;
  &lt;p&gt;The Controlled-NOT operator is applied to entangled systems. It flips the state of the second qubit if the state of the first qubit is 1 and leaves the second qubit unchanged if the first qubit is 0.

  \begin{align}
CNOT &amp;= \begin{bmatrix}
  1 &amp; 0 &amp; 0 &amp; 0 \\
  0 &amp; 1 &amp; 0 &amp; 0 \\
  0 &amp; 0 &amp; 0 &amp; 1 \\
  0 &amp; 0 &amp; 1 &amp; 0 
\end{bmatrix}
  \end{align}
 The tensor product transforms a 2-level system into a 4-level system before applying the CNOT operator. 
\begin{align}
A \otimes B =  \begin{bmatrix}
    A_{11} \begin{bmatrix}
    b_{11} &amp; b_{12} \\
    b_{21} &amp; b_{22} \\
  \end{bmatrix} &amp; A_{12} \begin{bmatrix}
    b_{11} &amp; b_{12} \\
    b_{21} &amp; b_{22} \\
  \end{bmatrix} \\
    A_{21} \begin{bmatrix}
    b_{11} &amp; b_{12} \\
    b_{21} &amp; b_{22} \\
  \end{bmatrix} &amp; A_{22} \begin{bmatrix}
    b_{11} &amp; b_{12} \\
    b_{21} &amp; b_{22} \\
  \end{bmatrix}\\
  \end{bmatrix}
  \end{align}

 Entangling $\ket{1}$ with $\ket{0}$ and applying CNOT on the resulting state will flip the state of the second qubit.
\begin{align}
  \begin{bmatrix}
    0  \\
    1  \\
\end{bmatrix} \otimes \begin{bmatrix}
    1  \\
    0  \\
\end{bmatrix} = \begin{bmatrix}
    0  \\
  0 \\
  1 \\
  0\\
  \end{bmatrix} = \ket{10}
  \end{align}

  \begin{align}
CNOT\ket{10} =  \begin{bmatrix}
  1 &amp; 0 &amp; 0 &amp; 0 \\
  0 &amp; 1 &amp; 0 &amp; 0 \\
  0 &amp; 0 &amp; 0 &amp; 1 \\
  0 &amp; 0 &amp; 1 &amp; 0 
\end{bmatrix}. \begin{bmatrix}
    0  \\
  0 \\
  1 \\
  0\\
  \end{bmatrix} = \begin{bmatrix}
    0  \\
  0 \\
  0 \\
  1\\
  \end{bmatrix} = \ket{11}

  \end{align}&lt;/p&gt;
  
  &lt;/section&gt;



   &lt;section&gt;
  &lt;h2&gt;Superdense coding&lt;/h2&gt;
  &lt;p&gt;Two bits of information can be encoded into one qubit. Superdense coding is performed by entangling two qubits and encoding two bits by applying an operator on one qubit. Entangled qubits are sent to the receiver who uses a decoder to read the bits that were encoded.

  Suppose the sender wants to send bits &lt;i&gt;01&lt;/i&gt;. He will transform the first qubit into a superposition of states.

  
  
\begin{align} 
 \ket{\psi} =  H(\ket{0})= \frac{1}{\sqrt{2}} \ket{0} + \frac{1}{\sqrt{2}} \ket{1} \tag{0}
  
  \end{align}


  The sender will entangle this qubit with a second qubit that is spin down.

  \begin{align} 
 \ket{\psi} =  CNOT(\frac{1}{\sqrt{2}} \ket{0} + \frac{1}{\sqrt{2}} \ket{1} \otimes \ket{0}) = \frac{1}{\sqrt{2}} \ket{00} + \frac{1}{\sqrt{2}} \ket{11}\tag{1}
  \end{align}

  The X operator is applied on the first qubit.
   \begin{align} 
 \ket{\psi} =  X \otimes I (\frac{1}{\sqrt{2}} \ket{00} + \frac{1}{\sqrt{2}} \ket{11}) = \frac{1}{\sqrt{2}} \ket{01} + \frac{1}{\sqrt{2}} \ket{10}\tag{2}
  \end{align}

  The reciever will use the first and second qubit to decode &lt;i&gt;01&lt;/i&gt; that was encoded in the first qubit.


   \begin{align} 
 \ket{\psi} =  CNOT(\frac{1}{\sqrt{2}} \ket{01} + \frac{1}{\sqrt{2}} \ket{10}) = \frac{1}{\sqrt{2}} \ket{01} + \frac{1}{\sqrt{2}} \ket{11}\tag{3}
  \end{align}


  \begin{align} 
  \ket{\psi} =  H \otimes I (\frac{1}{\sqrt{2}} \ket{01} + \frac{1}{\sqrt{2}} \ket{11}\tag{4})= \ket{01}
  
  \end{align}
  
The X operator is removed to encode &lt;i&gt;00&lt;/i&gt;. The Z operator is applied in place of X to encode &lt;i&gt;10&lt;/i&gt;. &lt;i&gt;11&lt;/i&gt;
 is encoded with Z and X.&lt;/p&gt;

 


  
   &lt;/section&gt;

   &lt;section&gt;
     &lt;h2&gt;Simulation of superdense coding&lt;/h2&gt;

    &lt;p&gt;It&apos;s not difficult to write a program simulates superdense coding. A program that consists of instructions we can run on a quantum computer is composed of commands where each line contains an operator and a qubit it&apos;s applied to. &quot;H 1&quot; means &quot;Apply the Hadamard operator to qubit 1&quot;. A program that encodes and decodes bits &lt;i&gt;01&lt;/i&gt; could be&lt;/p&gt;

     &lt;pre&gt;
  &lt;code&gt;
   H 0
   CNOT 0 1
   X 0 
   CNOT 0 1
   H 0
   MEASURE 0
   MEASURE 1
  &lt;/code&gt;
&lt;/pre&gt;
  

   &lt;p&gt;Since we don&apos;t have access to a quantum computer, we can run this program on a &lt;a href =&quot;https://github.com/vtomole/qchackers/blob/master/software/eagle/vm.py&quot;&gt; virtual machine&lt;/a&gt; that simulates a quantum computer.

   We paste the  &lt;i&gt;01&lt;/i&gt; coding program into a &lt;a href = &quot; https://github.com/vtomole/qchackers/blob/master/software/eagle/sd_coding.eg&quot;&gt; file&lt;/a&gt; and execute it on a virtual machine.&lt;/p&gt;
     &lt;pre&gt;
  &lt;code&gt;
    python vm.py python vm.py sd_coding.eg

    MEASUREMENT of qubit 0 is 0 

    MEASUREMENT of qubit 1 is 1 

  &lt;/code&gt;
    &lt;/pre&gt;

				    
				    
   &lt;/section&gt;


   &lt;section&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Superdense coding is a glimpse into the possibilities of quantum information. The principle of superposition and entanglement is used to encode two bits of information in one qubit. This technique can be executed on a quantum computer or a QVM.&lt;/p&gt;
&lt;section/&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/12&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   		

 &lt;section&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Superdense_coding&quot;&gt;Wikipedia entry on Superdense coding&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Qubit&quot;&gt;Wikipedia entry on Qubits&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Tensor_product&quot;&gt;Wikipedia entry on the Tensor product&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href = &quot;https://en.wikipedia.org/wiki/Quantum_gate&quot;&gt;Wikipedia entry on Quantum gates&lt;/a&gt;&lt;/li&gt;
  
&lt;/ul&gt;
&lt;section/&gt;

</content>
 </entry>
 
 <entry>
   <title>My 15 minute presentation on Quantum computing</title>
   <link href="http://vtomole.com/blog/2018/02/02/qcintrofan"/>
   <updated>2018-02-02T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/02/02/qcintrofan</id>
   <content type="html">&lt;p&gt;I did an &lt;a href=&quot;https://vtomole.github.io/static/qcintrofan.pdf&quot;&gt;Introduction to Quantum Computing&lt;/a&gt; talk for the Friday Activities at Noon (FAN) Club today. I feel like I covered important concepts on how quantum computers work and how they are built.&lt;/p&gt;

&lt;p&gt;I did not emphasize the difference between near-term and fault tolerant quantum computers; so there might have been a couple of people in the audience who thought that the quantum devices of the next 5-10 years will be able to factorize large numbers or search unsorted databases efficiently.&lt;/p&gt;

&lt;p&gt;If I had more time to present, I would have taken the opportunity to talk about the nuances of quantum computers; like the difference between physical and logical qubits. I would have also explained how simple quantum algorithms like Deutsch-Jozsa and Grover’s algorithms work. I did have the opportunity to demonstrate how quantum algorithms are programmed (I demoed a Bell State experiment using &lt;a href=&quot;https://github.com/rigetticomputing/pyquil&quot;&gt;pyQuil&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Overall, I feel like the presentation went extremely well. I would redo this talk if I had 15 minutes to explain quantum computing to Undergraduate Engineering Students.&lt;/p&gt;

&lt;p&gt;Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/issues/11&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>My 3 hours on Rigetti’s quantum processor</title>
   <link href="http://vtomole.com/blog/2018/01/06/qpu"/>
   <updated>2018-01-06T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2018/01/06/qpu</id>
   <content type="html">&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rigetti put their 19 qubit processor on the cloud at the end of last year. I was one of the first people to request access to it. I had the privilege of using this processor for 3 hours yesterday. Although I did not have a lot of time to play with all of the qubits that were on that computer, I had a lot of fun.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bell State&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Bell State experiment for qubit 0 and qubit 1 was successful 76/100 times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GHZ&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The GHZ experiment is the entanglement of 3 qubits. Running this experiment on the QPU got me the correct result 49/100 times.  The qubits I used were  q0, q1 and q2.  Since entangling qubits in hardware is a costly operation, it’s not surprising that this experiment performed worse than the Bell State.&lt;/p&gt;

&lt;p&gt;UPDATE: The circuit program that I used for GHZ was not efficient. Rigetti ran the GHZ experiement with a better circuit and they got the correct result ~70/100 times. Thanks Ryan Karle!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grover’s algorithm&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used q1 and q2 for 2 qubit implementations of Grover’s algorithm. Searching for 00 succeeded 84/100 times; 01 was a success 86/100 times; 10 81/100 times and 11 79/100 times. Running these algorithms on the QVM gave the correct answer 100% of the time. Grover’s algorithm is probabilistic, so the results from this processor was good because it gave the correct result with a high probability (82.5%).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Future Work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even though I had a 19 qubit computer at my disposal, I only used 2 qubits. I would like to perform Grover’s algorithm on a database of 19 qubits in the future.  I would also like to experiment with a deterministic quantum algorithm like Deutsch–Jozsa.&lt;/p&gt;

&lt;p&gt;There has recently been some tremendous progress in the development of quantum algorithms. Especially with respect to machine learning [3] [4] [5].  I unfortunately don’t have the experience required to be able to convert the results of these papers to programs that I can run on a quantum computer. Maybe someday…&lt;/p&gt;

&lt;p&gt;Discuss on &lt;a href=&quot;https://github.com/vtomole/vtomole.github.io/issues/10&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;0: &lt;a href=&quot;https://github.com/QCHackers/qchackers/tree/master/pyquil&quot;&gt;Code and results for the experiments&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1: &lt;a href=&quot;https://quantumexperience.ng.bluemix.net/proxy/tutorial/full-user-guide/introduction.html&quot;&gt;IBM Q Full User Guide&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2: &lt;a href=&quot;http://pyquil.readthedocs.io/en/latest/qpu_overview.html&quot;&gt;The Rigetti QPU&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3: &lt;a href=&quot;https://www.nature.com/articles/s41534-017-0017-3&quot;&gt;Demonstration of quantum advantage in machine learning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4: &lt;a href=&quot;https://medium.com/rigetti/unsupervised-machine-learning-on-rigetti-19q-with-forest-1-2-39021339699&quot;&gt;Unsupervised Machine Learning on Rigetti 19Q with Forest 1.2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5: &lt;a href=&quot;https://arxiv.org/abs/1712.05304&quot;&gt;A quantum algorithm to train neural networks using low-depth circuits&lt;/a&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Into Recurrent Neural Networks</title>
   <link href="http://vtomole.com/blog/2016/06/25/rnn"/>
   <updated>2016-06-25T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/06/25/rnn</id>
   <content type="html">&lt;p&gt;	I have spent the past few weeks trying to understand Recurrent Neural Networks; either they are very simple to understand, 
	or I am missing something. What I know is that Recurrent Neural Networks(Rnns) are meant to keep track of sequences. 
	This makes Rnns good for machine translation, speech recognition, and natural language processing. &lt;/p&gt;

	&lt;p&gt;Recurrent Neural Networks are recursive, hence their name. They are composed of cells. 
		These cells have the basic components of neural networks in that they are just nodes that are connected together 
		just like normal neural networks. The difference is that recurrent neural networks can also connect to themselves, 
		hence where the name “recurrent” comes from. This makes it so that unlike a basic or a convolution neural network, 
		a recurrent neural network has memory. For example, a Recurrent Neural Network can be used to predict a word based on previous words. 
		There is one glaring problem for Rnns, the vanishing gradient problem. The vanishing gradient problem is when training a neural network 
		becomes more difficult as the Rnn gets bigger. &lt;/p&gt; 

	&lt;p&gt;This is why we need to use Long Short Term Memory Networks (LSTMs), 
		These networks can hold memory for a very long time. LSTMs are like Rnns where they can hold a state that can be updated; 
		and there are functions inside the neural network that holds the current inputs and the previous outputs. 
		But an LSTM can hold memory for a longer period of time. An LSTM cell can decide on how long to hold a value and how long to 
		forget it based on how important that particular value(memory) is. This is a ingenious method of trying to simulate human memory.&lt;/p&gt;

	&lt;p&gt;Rnns are networks that that can take inputs and output values based on activation functions like normal neural networks, 
		the difference is that (Rnns) can connect to themselves in a recursive manner. This makes them capable of predicting 
		outputs based their own inputs (having a memory). Normal Rnns don&apos;t have good memory. 
		That is why LSTMs are used in practice because they can hold memory for as much time as they need to.&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/9&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   		</content>
 </entry>
 
 <entry>
   <title>My New Computer</title>
   <link href="http://vtomole.com/blog/2016/06/06/computer"/>
   <updated>2016-06-06T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/06/06/computer</id>
   <content type="html">&lt;p&gt;Last week; I learned a huge lesson, machine learning is costly. I paid around 1500 dollars for my new PC build. 
There were 2 reasons I got this PC. The first reason is because my PCs are very old. I have 3 PCs that are from the early 2000s.
One of them does not even turn on anymore and the other two are so old that the only Linux they can run is a lightweight distribution. I clearly needed a new computer.  I’ll still be using my old ones, for the nostalgia. Keep in mind that the 1500-dollar price tag was only for the build. I still have my old monitor, keyboard and mouse that are over 10 years old. They work perfectly fine so I don’t see the need to waste anymore money. The PC has a 240Gb solid state drive and an msi 970 gaming motherboard.&lt;/p&gt;
&lt;p&gt;The second reason that I got this PC was for machine learning, I haven’t run any machine learning algorithms on it yet, but I will pretty soon.
The reason I need a 1500 dollars to build this was to support the GPU (Graphics Processor Unit). GPU’s were originally invented for gaming. 
They have thousands of cores that compute pixel values in parallel because gaming applications are graphics intensive. Since GPU’s do calculations in parallel, they are great for number crunching.  The difference between a CPU and a GPU is that a CPU has a small number of cores (from 2-8). A GPU has thousands of cores, so a GPU is great for parallel computations.&lt;/p&gt;
&lt;p&gt;There are two main driving forces of the recent artificial intelligence boom; the progress of hardware, 
and the amount of data that we have access to.
Reinforcement Learning and Artificial Neural Networks are relatively old ideas that were invented and implemented in the mid to late 20th century. 
In fact, Reinforcement Learning was used to beat human players in Backgammon in the 1990’s. 
The reasons these ideas didn’t flourish is because of Moore’s law; and because we did not have enough data (You need a lot of data to train neural networks). With a lot of data, you also need sufficient hardware to do the matrix calculations for these neural networks in an efficient way. With the rise of the internet, a lot of data can be collected to train neural networks. In 1990, if you wanted millions of images to train neural network to recognize pictures, it would be very expensive to get millions of images, now you can just write a program that crawls Google Images and can get millions of images in a couple of days.&lt;/p&gt; 
&lt;p&gt;The progress of hardware is mainly driven by the GPU. The GPU is a mini-supercomputer. It can do millions of calculations on its thousands of cores in parallel. A neural network that can take 2 days to train on a CPU can be trained on a GPU in 15 minutes. This means that if there is something wrong in the algorithm that you are running, you don’t have to wait a couple days to find out. With large enough data sets and large enough neural networks, sometimes training can take a couple of months on a CPU. In a GPU it only takes 1 or two days.&lt;/p&gt;
&lt;p&gt;The GPU that I have is NVIDIA GeForce 970. It’s big, and it’s powerful. I was already tested it on Windows, but I have to test on Linux later.
Testing it on Windows was not difficult, NVIDIA has platform for programming GPUS’s called CUDA &lt;a href =&quot;http://www.nvidia.com/object/cuda_home_new.html&quot;&gt; here is the website&lt;/a&gt;. They also make running your programs easy by integrating CUDA with Visual Studio. You can program in CUDA if you know C and C++, but you can also use python wrappers. I was able to write some simple programs like multiplying 2 matrices. The cool part was that I was running this program on my GPU! Not a CPU. I still don’t know anything about GPUs except the details of how different they are from CPU; but I know that the more I study CUDA architecture and learn how to implement my own machine learning algorithms, the more I will know about GPUs.&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/8&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   </content>
 </entry>
 
 <entry>
   <title>Neural Networks and Function Approximations</title>
   <link href="http://vtomole.com/blog/2016/06/06/fnapprox"/>
   <updated>2016-06-06T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/06/06/fnapprox</id>
   <content type="html">&lt;p&gt;Convolution neural networks are mainly used for computer vision. These Convolution Neural Networks, or Convnets, makes it so you don’t have to use a lot of parameters to train your network. These networks can be thought of as volumes because images have a width, height and a number of channels which are RGB (red, blue, green) values. When you multiply the height width and the color channel, you get a volume.&lt;/p&gt;
&lt;p&gt;Professor Winston makes the general idea of convnets easy to understand, He says that to be able to train a neural network on an image using a convnet, you run a neuron on a small part of the image. You then run this neuron on another small part of the image and you keep doing this until you have run the neuron on every pixel in the image. The output of this neuron is composed of a specific place in the image. This is the convolution of the image. The convolution of this image is composed of a couple of points. You take the local maximum of these values and construct another image with these values. You then slide over the neuron of the image that you just created and do the same process that you did for the original image and get other points/values. This process is called max pooling because you are taking the maximum of the local points in the image. Min pooling is doing the opposite, where you take the local minimum of the values in the image.&lt;/p&gt;
&lt;p&gt;The tool that you use to scan a small part of an image is called a kernel. This kernel will detect the features in the network. The great part about this process is you can collect as many kernels as you want, you can collect 50 kernels, 100 kernels and more. You then put these kernels through your trained neural network and your neural network decides on whether the image is a dog, car, table, etc.&lt;/p&gt;

 
    &lt;p&gt;The most significant lesson that I learned this week is that neural networks are just elaborate function approximation tools. That is the only reason they exist, to approximate functions.
    When you are performing supervised learning, you have a function that you know, but your artificial neural network doesn’t.  
    You then tweak the weights and biases of this network until your network’s function is exactly the same one that you have. 
    Michael Nielsen give some great examples of how neural networks compute any function. You can find that material here. 
    Since artificial neural networks are used to approximate functions with as little error as possible, they are great for reinforcement learning. 
    The Backpropagation Algorithm, specifically The Gradient decent is used to find the minimum of the function so that the error is as small as possible. &lt;/p&gt;

&lt;p&gt;To make these ideas concrete, suppose that you wanted to train a robot how to shake a hand, what you do is give it a lot of data of people shaking hands with a dummy robot. 
This data would not specifically be videos, but only the data of the Markov states, the value functions and the amount of reward that the dummy robot is getting. 
The robot would then; through trial- and error, use this data to tweak its neural networks so that it could shake someone’s hand.
The best part would be that you wouldn’t have to program the robot to shake someone’s hand! It would learn on its own! 
&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/7&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   

&lt;h2&gt;Reference:&lt;/h2&gt;
&lt;p&gt;Winston, Patrick H. &quot;Lecture 12B: Deep Neural Nets.&quot; MIT OpenCourseWare. MIT OpenCourseWare, 2015. Web. 30 May 2016.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Into Markov Chains</title>
   <link href="http://vtomole.com/blog/2016/05/11/markov"/>
   <updated>2016-05-11T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/05/11/markov</id>
   <content type="html">&lt;p&gt;
The last post talked about Markov Chains, so the next step is to use these chains to implement a reward process that is the basis for Reinforcement Learning. The reward process (Specifically the Markov Reward Process) is composed of a state space, a state transition matrix, a reward function, and a discount factor. 
The discount factor just represents how much importance the agent puts on getting a reward immediately versus getting a reward later. When the discount factor is 0, the agent will do an action that will give it a reward immediately, when the factor is 1, then the agent places an importance on delayed gratification. For example, if someone offers me a cake and my discount factor is 0, I am looking for an instant gratification, so I would eat the cake immediately. But when my discount factor is one, I politely say no to the cake and eat an apple instead. The second decision is better for my health so I was aiming for a long term gratification.&lt;/p&gt;


&lt;p&gt;Every state in the state diagram should be labeled with a reward. This reward could be based on a point system. For the state diagram that I made in my last post, I would say that sleeping gives me a reward of 1 point, studying gives me a reward of 10 points, eating gives me a reward of 3 points and hanging out online is -14 points (because hanging out online tends to be a time-waster and it is the most addictive compared to other states on this diagram). The reward and discount factor can be mixed into one equation that keeps track of how much the agent is getting as it moves from one state to another. This equation is called the return. In any Markov Reward Process, we want to maximize our return.&lt;/p&gt;
 	&lt;p&gt;Now that we have defined the return, we can move on to the value function. the value function represents the value of a function after many state transitions. It is dependent on the discount factor. If the discount factor is 0, then the value of that state is the same as the reward of that state since the agent wants an instant reward. But as the discount factor moves away from 0, the state value of a certain state will not be the same as the reward of that state since the long term reward will be of a higher priority to the agent.&lt;/p&gt;


&lt;p&gt;You can make a Bellman function using the properties of a value function. The Bellman function states that the value of a state is based on the reward of that state added with the values of the outgoing states multiplied with the probabilities of coming out of your state and going to the next states. Simply put, the Bellman equation is:  v = r + d + p * v where v is the value, r is the reward, d is the discount, and p is the transition probability matrix. The Bellman equation is very important because it breaks a big problem into “bite-sized” sub problems that we are capable of solving.&lt;/p&gt;

&lt;p&gt;
The concept of Reinforcement Learning is thankfully not complicated at all. In my last post, I was wondering how I was going to implement a reward process for my agent. 
David Silver’s second Reinforcement Learning lecture answered that.
He said that all Reinforcement Learning problems can be conceptualized in the form of Markov Chains.
An awesome tutorial for Markov chains that I used is &lt;a href =&quot;http://setosa.io/ev/markov-chains/&quot;&gt;here &lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;A Markov Chain is a process of a state space (just a list of states) that can be drawn as a graph.
The process of a Markov Chain is based on a probability of a cursor moving from one state to another.
I am familiar with state spaces because I studied Finite State Machines last semester. For my class final project,
I created a state machine and I used it to implement a random number generator. 
The good thing about Markov Chains is that it does not need to remember all of the past events, it only uses that current event to decide the next state. 
This is called the Markov Property.&lt;/p 

&lt;p&gt;The Markov Chain can be modeled in 2 ways, with directed graphs; where vertices represent the state and the edges represent the probabilities, and a transition matrix.
The transition matrix is used more often because a Markov Chain can get very complex. 
These complexities can get so big that it may be impossible or tedious to model a Markov Chain using a graph.
This is why a transition matrix is almost always used to model Markov Chains.  &quot;Every state in the state space is included once as a row and again as a column. And each cell in the matrix tells you the probability of transitioning from its row state to its column state.&quot;- Powell.
&lt;/p&gt;
	
&lt;p&gt;I won’t get into the specifics of transition matrix mathematics (because I don&apos;t know any of it yet), but I will create transition matrix. 
This transition matrix models my day to day life in the summer. The main activities that I do in the summer is sleep, eat, study, and hang out online. 
I am going to use numbers between 0 and 1 to model the probabilities where a 10 percent chance is 0.10 and a 50 percent chance is .50. 
I created this transition matrix by first creating a state diagram, but I am unable to put a state diagram on here at the moment.
My state diagram starts from sleeping and it goes on from there. Every outgoing edge from any one of my states should add up to 1 because all probabilities are supposed to add up to 100 percent.&lt;/p&gt;

 
&lt;p&gt;The transition matrix below conceptualizes a Markov Chain beautifully. It shows all of the transitions from a state to other states, for example the probability that I go from sleeping to sleeping again is 0.1, the probability that I go from eating to hanging out online is .75. The columns of the matrix are supposed to represent the arrows going from each state so each column should add up to 1 because there is 100 percent probability that something will happen no matter what state I am in.&lt;/p&gt;


&lt;table border=&quot;2&quot;&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Sleeping&lt;/td&gt;
&lt;td&gt;Eating&lt;/td&gt;
&lt;td&gt;Studying&lt;/td&gt;
&lt;td&gt;Hanging out online&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sleeping&lt;/td&gt;
&lt;td&gt;0.1&lt;/td&gt;
&lt;td&gt;0.25&lt;/td&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;td&gt;0.075&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Eating&lt;/td&gt;
&lt;td&gt;0.30&lt;/td&gt;
&lt;td&gt;0.05&lt;/td&gt;
&lt;td&gt;0.10&lt;/td&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Studying&lt;/td&gt;
&lt;td&gt;0.02&lt;/td&gt;
&lt;td&gt;0.175&lt;/td&gt;
&lt;td&gt;0.30&lt;/td&gt;
&lt;td&gt;0.15&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hanging out online&lt;/td&gt;
&lt;td&gt;0.67&lt;/td&gt;
&lt;td&gt;0.75&lt;/td&gt;
&lt;td&gt;0.10&lt;/td&gt;
&lt;td&gt;0.70&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The next step is figuring out how to model the reward process using Markov Chains.&lt;/p&gt;

&lt;p&gt;
There are three methods of solving a Markov Decision process, these methods are, Dynamic Programming, Monte Carlo, and Temporal Difference Learning.&lt;/p&gt;

&lt;p&gt;Dynamic Programming is a method where you know the full Markov Decision Process. The pros of this method, is that there is a specific algorithm that you can use to find your value function. The way this method is taught is “grid world” This is a grid that contains the value functions and determines the optimal policy that each state will contain until the state terminates. I am still trying to understand this grid world, so I can’t go into the specifics aspects of it.&lt;/p&gt;

&lt;p&gt;Reinforcement learning depends on optimizing value functions. There also some situations where you don’t know what your Markov Decision Process is. This is an area that is suited for the Monte Carlo Method.  The Monte Carlo Method relies on random sampling and it is also used for numerical integration.  This random sampling is akin to the agent trying out everything in its environment and finding out what maximizes it’ s value function. This means that the Monte Carlo method learns from experience.&lt;/p&gt;

&lt;p&gt;Temporal Difference Learning is a fundamental concept in reinforcement learning because it combines Dynamic Programming and the Monte Carlo Method. This method, like Monte Carlo also learns from experience, and it doesn’t have a Markov Decision Process. Unlike the Monte Carlo Method, Temporal Difference learning does not need the state to terminate to get the value function. Like Dynamic Programming, Temporal Difference Learning updates the value functions on the fly, the episode does not have to terminate. This is called bootstrapping.&lt;/p&gt;

&lt;p&gt;The methods that solve a Markov Decision Process have the same steps. The first step is the policy evaluation that estimates the value function for a policy. The second step is finding the optimal policy, which is improving the policy when you have a value function. 
&lt;/p&gt;

&lt;h2&gt;References:&lt;/h2&gt;
&lt;p&gt;Powell, Victor. &quot;Markov Chains Explained Visually.&quot; Explained Visually. N.p., n.d. Web. 11 May 2016.&lt;/p&gt;

&lt;p&gt;Silver, David. &quot;Markov Decision Processes.&quot; SpringerReference (n.d.): n. pag. 2015. Web. 5 May 2016. &lt;/p&gt; 
&lt;p&gt;Sutton, Richard S., and Andrew G. Barto. Reinforcement Learning: An Introduction. Cambridge, MA: MIT, 1998. Print. &lt;/p&gt;

&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Into Reinforcement Learning</title>
   <link href="http://vtomole.com/blog/2016/05/09/reinforcement"/>
   <updated>2016-05-09T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/05/09/reinforcement</id>
   <content type="html">&lt;p&gt;
The basic premise of this type of learning is that an agent only does things that can maximize its reward. The agent doesn’t know if what its doing is good or bad, you just give it a reward if it does what you want. This is the same concept that can also be applied to animals, a classic example of this type of learning is Pavlov’s dog. Another example is the way children learn. Children get punished when they don&apos;t do what an authority figure wants of them, and they get rewarded when they do what an authority figure wants.&lt;/p&gt;

&lt;p&gt; The same principle can be applied to an agent. An agent takes in an observation, a reward from the environment and then it outputs an action to the environment. The 
agent that takes in these inputs and outputs can be thought of as a black box for now, but inside that black box, there are algorithms that calculate the output based on the rewards and the state of the environment that the agent is in. This self-perpetuating cycle is another type of machine learning.
&lt;/p&gt;

&lt;p&gt;To get started on Reinforcement Learning, I wrote a program that guesses a random number and terminates if the number 
    that was guessed is correct, the program is extremely simple, if fact this program is not AI related whatsoever. It&apos;s just random number checker, but it&apos;s a start nonetheless. It goes against the true nature of reinforcement learning but it gets some of the basics correct. The random function guesses a number, if the number that is guessed is not 9, then the program keeps guessing a number until it guesses the correct one. The problem with this program is that I am not giving it a reward, and it’s not learning that 9 is the correct answer. What I need to do is have a point system where if it guesses 9, I give it 1 point, if it guesses anything else, I subtract one point and my agent should learn that by guessing 9, it will earn more points.
&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/4&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   
&lt;h2&gt;References:&lt;/h2&gt;
&lt;p&gt;Silver, David. &quot;Lecture 1: Introduction to Reinforcement Learning.&quot; (n.d.): n. pag. 2015. Web. 5 May 2016. http://www0.cs.ucl.ac.uk/staff/d.silver/web/Teaching_files/intro_RL.pdf. &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Backpropagation using an alternative Activation Function</title>
   <link href="http://vtomole.com/blog/2016/04/30/backprop"/>
   <updated>2016-04-30T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/04/30/backprop</id>
   <content type="html">&lt;p&gt;The backpropagation algorithm has two parts, the Forward-Propagation and the Backpropagation. Forward-Propagation is the first half of Backpropagation that is used to find the loss of the neural network. The loss could be called an error because it shows the magnitude of error that our neural network outputs. &lt;/p&gt;

&lt;p&gt;This error is calculated by multiplying our weights with our input and passing the product of these vectors to our activation function.  The activation function is just supposed to take in the array of numbers and squish those number between the ranges of those activation function. This number is then stored in a hidden neural layer. It is used to calculate the loss (error) by subtracting the output from the values of the hidden neural layer (The number that our activation returned)&lt;/p&gt;
&lt;p&gt;The second half of this algorithm is Backpropagation. Backpropagation is moving backwards on the network and (as far as I know right now), we multiply the hidden neural layer by the gradient of the state of what our weights are in. Once this is done, we change the weights to the dot product of our input array and the gradient of what we calculated during our Forward propagation (the second layer of the network, on a two layer network). Backpropagation is a heavy subject, so I’ll be spending more time studying it.&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
The tutorial that I&apos;ve been using to study neural networks uses the logistic function to predict the output of a truth table using three inputs. The table below shows the three inputs x,y, z and an output. As you can see, x is exactly the same as the output. These are the kinds of patterns that neural networks are supposed to recognize. This is also the same method that humans use to learn, by recognizing patterns. The difficulty is just how complex those patterns are.&lt;/p&gt;
&lt;p&gt; The example that I was using, which is cited below; uses a logistic function to predict the output. I was wondering if I could get the same behaviour from a simple neural network using a different Activation Function. The Activation Function that I used is called the Tanh function. The Tanh function is explained well &lt;a href =&quot;http://mathworld.wolfram.com/HyperbolicTangent.html&quot;&gt;here&lt;/a&gt;. If you look at this function&apos;s graph, it looks similar to the logistic function except instead of having a range from 0 to 1, it has a range from -1 to 1. I don&apos;t know enough about neural networks to tell when you want to use a certain function over another, but I will find out soon enough! &lt;/p&gt;


&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;
&lt;td&gt;x&lt;/td&gt;
&lt;td&gt;y&lt;/td&gt;
&lt;td&gt;z&lt;/td&gt;
&lt;td&gt;output&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt; These were the results I got after training the neural network 100,000 times.

&lt;table border=&quot;1&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Output After Training&lt;/td&gt;
&lt;td&gt;Expected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-0.99999703&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-0.99999702&lt;/td&gt;
&lt;td&gt;-1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.99999702&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.99999703&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;     

&lt;p&gt;As you can see, the results are not completely perfect, but the network and the inputs were easy enough for them to be close, this shows that learning is never perfect and there is always some error that we have to account for in all our learning algorithms.

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/4&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;   
&lt;h2&gt;Reference:&lt;/h2&gt;
&lt;p&gt;Trask, Andrew. &quot;A Neural Network in 11 Lines of Python (Part 1).&quot; Iamtrask. N.p., 12 July 2015. Web. 30 Apr. 2016. &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Basic Machine Learning</title>
   <link href="http://vtomole.com/blog/2016/04/23/basicml"/>
   <updated>2016-04-23T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/04/23/basicml</id>
   <content type="html">&lt;p&gt;Backpropagation is the standard Machine Learning algorithm. From what I understand, It works like this:&lt;/p&gt;

&lt;p&gt;1. Set all the weights of your neural network to random values.&lt;/p&gt;
&lt;p&gt;2. Take a training example, put it through your neural network and try to predict what your neural network will make of it.&lt;/p&gt;
&lt;p&gt;3. Compare what your neural network’s output is with the output that you want (the correct output).&lt;/p&gt;
&lt;p&gt;4. Adjust your weights.&lt;/p&gt;
&lt;p&gt;5. Keep doing this over and over again until your network gets the output that you want. Once this happens, your neural network has learned.&lt;/p&gt;
&lt;p&gt;This is called Supervised Learning because you can check if your network is correct or not by comparing the results of your network to your training examples.&lt;/p&gt;

&lt;p&gt;The weights are adjusted using the Gradient Decent Algorithm. This is how the weights and biases are tweaked. The Gradient Decent is summarized well 
    &lt;a href =&quot;http://mathworld.wolfram.com/MethodofSteepestDescent.html&quot;&gt;here&lt;/a&gt;. It finds the local minimum of a function. This is when the slope of the function is zero. (In other words, when the derivative of the function is equal to 0.) The problem is you can only efficiently find the derivative of a function that has a few variables. Neural Networks can get very big, sometimes having millions of variables. 
So computing the the derivatives of these types of functions is computationally intensive. That is why the Gradient Decent Algorithm is used for huge networks. 
The next step for me is to write a program for the Gradient Decent Algorithm and maybe also a program that can compute general derivatives. &lt;/p&gt;

&lt;p&gt;Summary: Backpropagation finds the error that your weights have by 
    comparing your neural network’s output to the output that you want you network to have and 
    the Gradient Decent Algorithm is used to adjust these weights.&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/3&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;References:&lt;/h2&gt; 
&lt;p&gt;Michael A. Nielsen, “Neural Networks and Deep Learning”&lt;/p&gt;
&lt;p&gt;Trask, Andrew. &quot;A Neural Network in 13 Lines of Python (Part 2 - Gradient Descent).&quot; - I Am Trask. N.p., 27 July 2015. Web. 23 Apr. 2016.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>The Simplest Artificial Neuron</title>
   <link href="http://vtomole.com/blog/2016/04/15/neuron"/>
   <updated>2016-04-15T00:00:00+00:00</updated>
   <id>https://vtomole.com/blog/2016/04/15/neuron</id>
   <content type="html">    &lt;p&gt;
        The human brain is a complicated system that is responsible for every single human accomplishment and endeavor. It is the best example we currently have of intelligence. This is the kind of intelligence that researchers are currently trying to emulate. If we are trying to understand the brain at it&apos;s most basic level, We can started by learning about neurons.
        Neurons are the underlying cause of all human congnition and behavior. Neurons are also not unique to humans, most animals have neurons. These neurons communicate to each other with electrical signals and chemical processes.
        The neurons in the nervous system communicate through axon terminals and dendrites. This means every neuron has an input and an output.&lt;/p&gt; 


&lt;p&gt;An artificial neuron is also structured in the same way (It has an input and an output). An artificial neuron has weight vector which determines how important an input is for the kind of output that we want from the neuron. The artificial neuron also has an activation function that gives us the actual output of the neuron. We take the dot product of the input vector and the weight vector to get the input that we need for our activation function.
&lt;a href =&quot;http://mathworld.wolfram.com/DotProduct.html&quot;&gt;Here is a quick summary of the Dot Product.&lt;/a&gt; 

The activation function that is commonly used is The Sigmoid Function. &lt;a href =&quot;http://mathworld.wolfram.com/SigmoidFunction.html&quot;&gt;Here is a quick summary of the Sigmoid Function.&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Summary: A simple Artificial Neuron is a Sigmoid Function whose input is the dot product of the weight vector and the input vector.&lt;/p&gt;

&lt;p&gt; Discuss on &lt;a href = &quot;https://github.com/vtomole/vtomole.github.io/issues/2&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Reference:&lt;/h2&gt;
&lt;p&gt;Nielsen, Michael. &quot;CHAPTER 1.&quot; Neural Networks and Deep Learning. VisionSmarts,Ersatz,G Squared Capital,TinEye, 22 Jan. 2016. Web. 15 Apr. 2016.
&lt;/p&gt;

</content>
 </entry>
 
 
</feed>
