quantum computing, romance novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “romance...

57
1 Quantum Computing, Quantum Computing, Romance Novels, Romance Novels, Life Life

Upload: others

Post on 26-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

1

Quantum Computing,Quantum Computing,Romance Novels,Romance Novels,

LifeLife

Page 2: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

2

Course Evaluations

● Should we offer PL and Compilers Practicum options in the future?

● Do you appreciate having difficult classes, assuming we warn you in advance?

Page 3: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

3

Upcoming Due Dates

● Mon May 05– EVERYTHING.– If I have the wrong grade marked down for you

(see projected grades) or you want to turn something in late, Mon May 05 is the time.

● PL: No Final (grade out of 75 points)– Only 3 students wanted one ...

● Compilers: No Final– Only 2 students wanted one ...

Page 4: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

4

One-Slide Summary

● A quantum computer manipulates quantum bits; such qubits can represent a superposition of possible states.

● Quantum computers are probabilistic. Grover's Algorithm (for linear search in sub-linear time) and Shor's Algorithm (for factoring integers in polylog time) are common quantum algorithms.

● When you use a quantum computer to “try everything in parallel” you get back a random answer.

Page 5: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

5

Page 6: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

6

The Key● The key to quantum algorithms is to make a

bunch of parallel worlds that all have something (part of the right answer) in common.

Page 7: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

7

Shor's Algorithm Prelude● Goal: find factors of large integer N = p * q● Let's assume we've made our superposition

– x mod N, x2 mod N, x3 mod N, x4 mod N, ...● So, given a superposition of elements in a

periodic sequence, how do we extract the period?– If we find it, Euler gives us (p-1)(q-1), and we win

● We use the Quantum Fourier Transform– The heart of Shor's Algorithm (1994)

● Reasoning by analogy time!

Page 8: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

8

Groundhog Day● You're on a 27 hour day. ● Let's imagine that your bedroom has many

clocks in it– One clock has 27 hours per day– One clock has 3 hours per day, etc.– Each hour is still 60 minutes on all clocks

● Each clock has its own posterboard with a thumbtack in it – mounted right below the clock– When you wake up, you move each thumbtack in

the direction of its clock's hour hand

Page 9: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

9

Bedroom Of Doom!

● Three of your clocks: 4-hour, 3-hour, 8-hour:

X X X

Page 10: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

10

Bedroom Of Doom! (1pm)

● Let's say the current time is 1pm on all clocks.

X X X

Page 11: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

11

Bedroom Of Doom! (1pm)

● Let's say you're on a 3-hour day, so you wake up every three hours.

● So when next you wake up, it'll be three hours later ...

X X X

Page 12: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

12

Bedroom Of Doom! (4pm)

● So you adjust the clocks

X X X

Page 13: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

13

Bedroom Of Doom! (4pm)

● So you adjust the clocks

● And move the thumbtacks ...

X XX

Page 14: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

14

Bedroom Of Doom! (7pm)

● Wakey Wakey! So you adjust the clocks

● And move the thumbtacks ...

XX

X

Page 15: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

15

Bedroom Of Doom! (10pm)

● Wakey Wakey! So you adjust the clocks

● And move the thumbtacks ...

X

X

X

Page 16: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

16

Bedroom Of Doom! (1am)

● Sigh! So you adjust the clocks

● And move the thumbtacks ...

X

X

X

Page 17: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

17

Bedroom Of Doom! (4am)

● Sigh! So you adjust the clocks

● How can you tell which clock matches your period?

X

X

X

Page 18: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

18

Periodic MotionIt's Just A Jump To The Left

● If you're on a 3-hour day, the 4-hour clock's thumbtack drifts around a little, but every few days it returns to the center– All of the movements cancel each other out!

● On the other hand, from the perspective of the 3-hour clock you've been waking up at the same time each “morning”– So you keep moving that thumbtack in the same

direction!● So just find which thumbtack is farthest from

the center and you've found the period.

Page 19: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

19

QFT, QED.● The Quantum Fourier Transform is a linear

(unitary) transformation that maps a vector of complex numbers to another vector of complex numbers

● Input vector has nonzero entries every time I wake up, zero entries everywhere else

● Output vector records thumbtack positions● In the end: it's a linear transform mapping

quantum state encoding a periodic sequence to a quantum state encoding the period of the sequence!

Page 20: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

20

Interference● In quantum-land, probabilities are always non-

negative but amplitudes may be negative, positive or even complex.

● Thus amplitudes corresponding to different ways of getting a particular answer can intefere destructively and cancel each other out

● In Shor, all periods from all observations (i.e., all alternate universes) other than the true one cancel each other out. Only for the true period do contributions from all observations (i.e., all universes) point in the same direction.

Page 21: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

21

Shor's Algorithm● On a quantum computer, Shor's Algorithm

takes O((log N)3) time to factor the integer N– Recall: best classical time ~O(2logN)

● In 2001, a team at IBM implemented Shor's algorithm and factored 15 using 7 qubits– Experimental realization of Shor's quantum

factoring algorithm using nuclear magnetic resonance

– “We use seven spin-1/2 nuclei in a molecule as quantum bits, which can be manipulated with room temperature liquid-state nuclear magnetic resonance techniques.”

Page 22: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

22

Did We Win?

● A normal Turing machine can simulate a quantum computer (slowly ...)– So we do not gain any expressive power– Quantum computers do not solve the halting

problem● But quantum computers sure seem faster!● The class of problems that can be solved

efficiently by quantum computers is called BQP (bounded error, quantum, polynomial time).

Page 23: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

23

P = NP ?

● So: “quantum computers can solve NP-complete problems in polynomial time” ?

Page 24: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

24

P = NP ?

● Misconception: “quantum computers can solve NP-complete problems in polynomial time”

● BQP is suspected to be a superset of P and disjoint from NP (this is unknown)

Page 25: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

25

What Is Quantum Good For?

● BQP contains Integer Factorization– Believed to be in NP but not in P

● BQP contains Discrete Log– Believed to be in NP but not in P

● BQP contains Quantum Database Search– Can give an N2 speedup on any NP-complete

problem (by searching through all the answers), but that's still exponential time

● And that's currently about it.

Page 26: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

26

Q: Movie Music (437 / 842)

● This most common word in the 1991 Disney song Belle remains the same in the French localization of the movie.

Page 27: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

27

Q: General (481 / 842) ● In 1983 this man challenged the

major findings of Margaret Mead, a famous cultural anthropologist, five years after she died. He based his highly questionable critique on four years of field experience and recent interviews with survivors of Mead's original study.

Page 28: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

28

Q: Events (607 / 842)

● This Palestinian "uprising", sometimes called "the war of the stones", began on December 8, 1987.

Page 29: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

29

Q: Cartoons (663 / 842)

● Give all four Renaissance artist names chosen by Splinter the Rat for his four mutant ninja disciples in the 1984 comic book and 1987 cartoon.

Page 30: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

30

Q: Books (731 / 842)

● This 1958 ursine children's book character was created by Michael Bond. He likes marmalade and is known for the railway station where he was found.

Page 31: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City
Page 32: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

32

Dispelling Romance Novel Myths

● Tell me something about romance novels ...

Page 33: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

33

Why Should We Care?● In North America, romance novels comprise 55% of all

paperbacks sold

– Most popular genre in modern literature

– And 39% of all fiction sold

– Also Europe & Australia, over 90 languages, etc.● In 2012, romantic fiction generated $1.438 billion in

sales (thousands of separate novels that year)

– 64 million people claimed to read at least one in 2004 (up 21% from 2001)

– 22% male, 50-50 married/single, 42% BA/BS

– 28/190 world countries have GDP < $1.2 billion

Page 34: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

34

On The Street

● “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City Library in Springfield, Mass in 2013. "Romance makes up 35% of our more-than-5,000-item collection but accounts for over 43% of the circulation. On average, romance paperbacks circulate more than eight times, while items in other genres circulate fewer than six. The cost of romance novels is generally less than [the cost of novels from] many of the other genres, and with high circulations this results in a better return overall on the library's investment."

Page 35: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

35

What Are We Talking About?

● According to the Romance Writers of America, the main plot of a romance novel must revolve around the two people as they develop romantic love for each other and work to build a relationship together. Furthermore, a romance novel must have an "emotionally satisfying and optimistic ending."

● Nora Roberts claims "The books are about the celebration of falling in love and emotion and commitment, and all of those things we really want."

Page 36: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

36

Freedom?

● Modulo societal taboos, almost anything can appear in a romance novel. – Castles, domestic violence, science fiction,

disabilities, children, religion, date rape, medicine, suspense, exotic locales, chaste kisses, etc.

● So let's do a brief history and taxonomy of romance novels and occasionally use them as a lens for studying society

Page 37: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

37

Ancient History● 1740: Pamela, or Virtue Rewarded by Samuel

Richardson– First popular novel based on heroine's perspective

● 1813: Pride and Prejudice by Jane Austen– Often critically considered “the best romance

novel ever written”– Reinforces stereotype that women must marry?

● 1847: Jane Eyre by Charlotte Bronte– Orphaned heroine, gothic elements, Elizabethan

drama, “demonstrated the flexibility of the romance novel form”

Page 38: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

38

History● 1919: The Sheik by E.M. Hull

– Popular, movie with Valentino, hero kidnaps heroine and wins her affection through “forceful action”

● One of the first to introduce the rape fantasy [Regis 2003]. Publishers believed that readers would only accept premarital sex in the context of rape. In this novel and those that followed, the rape was depicted as more of a fantasy; the heroine is rarely if ever shown experiencing terror, stress, or trauma as a result.

● 1921+: Many by Georgette Heyer

– Set during English Regency Period (1811-1820)

– Used setting as a plot device: characters would have modern day sensibilities (e.g., marrying for love) and would be marked as eccentric

Page 39: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

39

Pre-Modern Era

● 1930+: Mills and Boon hardback romances– UK Company, sold in weekly two-penny libraries

● 1957: Harlequin sells M&B books in America– Had a “decency code”

● cf. Hays Production Code in US Cinema, 1934-1968: replaced in modern era by MPAA ratings

● Intimacy limited to chaste kisses between protagonists

● 1971: Harlequin purchases Mills & Boon– Chose to sell books “where the women are”:

supermarkets, drug stores, etc.

Page 40: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

40

The Modern Era

● 1972: The Flame and the Flower by Kathleen Woodiwiss (Avon publishers)– First romance novel “to [follow] the principles into

the bedroom”; first to be published directly in paperback; was distributed in drug stores; went on to sell 2.35 million copies

● By 1975 Avon's 4 romances sold 8 million combined copies

● By 1976 over 150 historical romance novels were published selling over 40 million copies

Page 41: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

41

Two Types Of Romance

● Category Romances (series romances)– Short: 200 pages; 55,000 words; multiple books in

a line published each month– “pare the story down to its essentials. Subplots

and minor characters are eliminated or relegated ...”

– Wide distribution, staying on shelves until sold out or until next month's titles arrive

● Single-Title Romances– Longer: 350-400 pages, 1/year, remain on shelves– Not always stand-alone, often Author-driven

Page 42: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

42

Subgenres

● 40% Category Romance● 17% Historical Romance● 16% Contemporary Romance● 9% Paranormal Romance● 7% Romantic Suspense● 6% Inspirational Romance● 5% Other

Page 43: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

43

Social Mores: Romance Novels 1980s

● 1980: WSJ refers to “bodice-rippers” as “publishing's answer to the Big Mac: they are juicy, cheap, predictable, and devoured in stupifying quantities by legions of loyal fans”

● Contemporary romances: weak females falling in love with alpha males

● Historical romances: heroines active in the plot, but “passive in relationships with heroes”

● All genres: heroines 16-21 virgins, heroes ~30 not, all are beautiful

Page 44: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

44

The Sun Also Rises And Falls● 1975: Harlequin purchases a romance novel that takes

place in America with American morals

– In the late 70's they rejected Nora Roberts because “they already had their American writer”

● 1980: The Tawny Gold Man by Amii Lorin

– First to waive the virgin heroine requirement

– By 1983, sales of that line totaled $30 million

– Similar lines soon had 90-100% monthly sellout rates● 1984: Market Saturation (40% sellout rates)

– “dampening effect of the high level of redundancy associated with series romances was evident in the decreased number of titles being read per month”

Page 45: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

45

Social Changes● 1984: overweight, middle-aged hero● 1987: ugly hero, heroine searching for birth

mother● Late 1980's: heroines in more male-dominated

jobs● 1990's: self-employed heroines, 30-40 year old

women, sensitive men– Later: single parenthood, adoption, abuse– Taboos: terrorism, warfare, masculine sports

● 2000's+: “chick lit”, 50 Shades, paranormal, ...

Page 46: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

46

Category Romance

● Now the fun part ...● I'll show you a bunch of different category

romance lines● You try to identify the subgenre and target

audience

Page 47: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

47

Category Romance In Pictures

Page 48: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

48

Category Romance In Pictures

Page 49: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

49

Page 50: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

50

Category Romance In Pictures

Page 51: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

51

Category Romance In Pictures

Page 52: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

52

Category Romance In Pictures

Page 53: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

53

Category Romance In Pictures

Page 54: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

54

We joke, but ...

● 44% of 2013 romances are e-books: 26% for other genres

● With 25% of romances purchased from Amazon

● It is easier than ever to appeal to, or participate in, niche markets!

● The romance market is growing while others are shrinking.

Page 55: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

55

Future of PL and Computing● Quantum Computing, Biological Computing

– Not for many years. Theory but no practice.● Model-Based Development

– No. COTS: Yes. Problem: |spec| > |program| ...● Embedded Computing

– Big deal. Problem: C, classic compiler opts, ...● Multicore + Manycore

– Big deal. Problem: can't write parallel programs ...● Correctness + Maintainability > Performance

Page 56: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

56

Conclusion

● Programming Languages is the topic of ultimate mastery– It combines rigorous theory– With the best parts of industrial practice– It is the cosmic mayonnaise that holds CS together

● This class is difficult (and also curved)● Good job sticking it out!

Page 57: Quantum Computing, Romance Novels,weimerw/2014-4610/lectures/... · 2017-09-08 · “Romance novels do better here than any other genre," says Anna Mickelsen of the Springfield City

57

LifeWeimer recommends that you take classes on philosophy until you've covered epistemology, free will, logic, the philosophy of science, and “what it is like to be a bat”. Take cognitive psychology classes until you've covered perception and the Flynn effect. Take speech or rhetoric classes until you've covered persuasion. Take anthropology as well as gender studies classes until you've covered Mead and Freeman and you have a better feel for which behaviors are socially constructed and which may be essential. Take classes in statistics until you can avoid being fooled. Take classes in religion or ethics until you've covered the relationship between unhappiness and unrealized desires. Take classes in physics until you can explain how a microphone, radio and speaker all work. Take classes on government until you have an opinion about the feasibility of legislating morality. Take classes on history until you are not condemned to repeat the mistakes of the past.