【读书笔记】《Introduction to classical and quantum computing》 chapter 1

本文概述了经典计算的基础,包括比特的概念,解释了二进制和ASCII编码。逻辑门的介绍涵盖单比特和双比特门,如NOT、AND、OR、XOR、NAND和NOR,并讨论了它们在物理电路中的实现。此外,文章还涉及加法器、电路简化、布尔代数、可逆逻辑门、错误校正以及计算复杂性,如P类和NP类问题。最后,提到了图灵机和量子计算如何扩展了计算的可能性。
摘要由CSDN通过智能技术生成

Chapter 1:Classical Information and Computation

本章介绍经典计算。
Quantum computing is not developing in isolation of classical computing.
量子计算的发展并不独立于经典计算。
经典计算与量子计算对比图

1.1 Bits

The fundamental unit of classical information.

  1. Coins
    硬币有正(Head),反(Tail)两种状态
  2. Dice
    骰子有6种状态
    两个骰子有6*6种可能状态
  3. Encoding information
    两种状态是我们能辨认最小数目(当然了,一种状态还辨认啥)
  4. Physical Bits
    许多物理系统只有两种状态(比如开灯、关灯)
    所以我们引入binary digit:0、1
    A bit is the smallest unit of classical information.
  5. Binary
    二进制数是基于2的数
    最左边的位:the most significant bit
    最右边的位:the least significant bit
  6. ASCII(读作ass-key)
    用二进制编码文字
    7位一个字母

1.2 Logic Gates

  1. Single-Bit Gates
    truth table:真值表就是列出输入输出对
    最简单的门:一输入一输出
    输入可能为0、1,输出可能为0、1,总共有2*2=4种输入输出可能
    There are 4 possible single-gates:
    · identity gate:0->0,1->1(也叫buffer gate)
    · NOT gate:0->0,1->1(也叫inverter gate)
    · always 0 gate:0->0,1->0
    · always 1 gate:0->1,1->1
  2. Two-Bits Gates
    该类门有2个比特作为输入
    There are 5 most important two-bits gates:
    · AND gate:A*B
    · OR gate:A+B
    · Exclusive OR(XOR) gate:A⊕B
    · NAND gate A B ‾ \overline{AB} AB
    · NOR gate A + B ‾ \overline{A+B} A+B
  3. Logic Gates as Physical Circuits
    用电路可以实现逻辑门
  4. Multiple Gates
    可以组合门来组合出更多更复杂的运算
  5. Universal Gates
    universal gate set: a set of gates that can perform all possible logic operations
    {NOT,AND,OR};{NOT,AND};{NAND};{NOT,OR};{NOR}

1.3 Adders and Verilog

We can code circuits using Verilog(a hardware description language)

  1. Adding Binary Numbers by Hand
    加法
    · half adder:adds two bits and outputs a carry and a bit of the sum
    · full adder:adds three bits (a carry into the sum and the two bits we want to add) and outputs a carry and a bit of a sum
    · ripple-carry adder:stringing together a half adder and several full adders into a circuit

  2. Half Adder
    Here are input bits A and B, the sum S, and the carry bit C.
    half adder
    S = A⊕B, C = AB

  3. Full Adder
    full adder
    S = A⊕B⊕Cin, Cout = AB+Cin(A⊕B)

  4. Ripple-Carry Adder
    电路结构如下:
    在这里插入图片描述

  5. Ripple-Carry with Full Adders
    另一种电路结构

  6. Circuit Complexity
    2n bits相加
    Ripple-Carry: n full adders, each full adder uses 5 logic gates, 5n logic gates.
    Ripple-Carry with Full Adders: The first full adder can be replaced with a half adder,5n-3 logic gates.

1.4 Circuit Simplification and Boolean Algebra

可以用布尔函数对电路进行化简。

  1. Order of Operations
    运算顺序和规则类似普通数学。

  2. Association, Commutivity, and Distribution
    AND和OR遵循以下运算规则:
    associative 结合律
    ABC = (AB)C = A(BC)
    A+B+C = (A+B) +C = A+ (B+C)
    commutative 交换律
    AB = BA
    A+B = B+A
    distributive 分布律
    A(B+C) = AB+AC
    A+ (BC) = (A+B)(A+C)

  3. Identities Involving Zero and One
    • A0 = 0
    • A1 = A
    • A+0 = A
    • A+1 = 1

  4. Single-Variable Identities
    A = A ‾ ‾ A = \overline{\overline{A} } A=A
    A A = A AA = A AA=A
    A A ‾ = 0 A\overline{A}= 0 AA=0
    A + A = A A+A = A A+A=A
    A + A ‾ = 1 A+\overline{A} = 1 A+A=1

  5. Two-Variable Identities and De Morgan’s Laws
    Two-Variable Identities
    A + A B = A A + AB = A A+AB=A
    A + A ‾ B = A + B A+\overline{A} B = A+B A+AB=A+B
    De Morgan’s Laws
    A B ‾ = A ‾ + B ‾ \overline{AB} = \overline{A} +\overline{B} AB=A+B
    A + B ‾ = A ‾ ∗ B ‾ \overline{A+B} = \overline{A} *\overline{B} A+B=AB

  6. Circuit Simplification
    可以用以上定律进行电路化简。

1.5 Reversible Logic Gates

  1. Reversible Gates
    reversible gate: given the output(s) of the gate, we can always determine what the input(s) was (were).
    example: NOT gate

  2. Irreversible Gates
    • With a reversible gate, no information is lost since we can always recover the inputs from the outputs.
    • With an irreversible gate, information is lost since, given an output, we generally do not know what the inputs were.

  3. Toffoli Gate: A Reversible AND Gate
    Toffoli Gate
    真值表
    Toffoli gate is also universal.
    Toffoli gate= controlled-controlled-NOT gate= CCNOT gate:The third bit is flipped when A and B are both 1.
    Anti-Toffoli gate:
    Anti-Toffoli gate

  4. Making Irreversible Gates Reversible
    make gates reversible by XORing, ensuring that the outputs are unique.

1.6 Error Correction

  1. Errors in Physical Devices
    single event upset: High energy particles like cosmic rays, neutrons produced in the earth’s atmosphere, radiation from nuclear testing, and radiation from particle accelerators can strike computers, causing bits to flip from 0 to 1 and from 1 to 0.
    宇宙射线、地球大气层中产生的中子、核试验产生的辐射以及粒子加速器产生的辐射等高能量粒子可以撞击计算机,导致比特从0翻转到1,从1翻转到0。
    Errors: If we are transmitting data through the internet, then some bits may become corrupted.
    Detect/correct errors: 因为错误有限,所以可以探测和纠正

  2. Error Detection
    Repetition code(error-detecting code): The simplest way to detect errors is to repeat each bit multiple times so that multiple physical bits encode a single logical bit. 检测错误的最简单方法是将每个比特重复多次,使多个物理比特编码一个逻辑比特。
    Example: 00 encodes 0, 11 encodes 1; 出错了则为01或10。
    Codewords: 00,01,10,11
    Parity(奇偶校验位): whether the bit string has an even or odd number of 1’s.
    error syndromes: parity can be used to distinguish whether an error has occurred

  3. Error Correction
    error-correcting code: correct the error by taking the majority vote
    可以计算在某错误率下是否值得进行错误检查

1.7 Computational Complexity

  1. Asymptotic Notation
    Big-O notation: upper bound, less than or equal to
    5 n − 3 = O ( n ) 5n-3 = O(n ) 5n3=O(n)
    Little-o notation: upper bound, less than
    5 n − 3 = o ( n 2 ) 5n-3 = o(n^{2} ) 5n3=o(n2)
    Big-Omega notation: lower bound, greater than or equal to
    5 n − 3 = Ω ( n ) 5n-3 = \Omega (\sqrt{n}) 5n3=Ω(n )
    Big-Omega notation: lower bound, greater than
    5 n − 3 = ω ( n ) 5n-3 = \omega (\sqrt{n}) 5n3=ω(n )
    Big-Theta notation: both upper bound and lower bound, * linearly with*,
    5 n − 3 = Θ ( n ) 5n-3 = \Theta (n) 5n3=Θ(n)
    渐进符号汇总表

  2. Complexity Classes
    efficient: if it takes polynomial time or less.
    Polynomial time: The number of gates scales as a polynomial in n.
    Constant time: O(1),比多项式时间快
    Logarithmic time: O(log(n)),比多项式时间快
    inefficient:if it takes more than polynomial time(superpolynomial time
    exponential time:such as 2 n 2^{n} 2n or e n / 1000 e^{n/1000} en/1000.
    subexponential time: less than exponential time but greater than polynomial time, such as 2 n 1 / 3 2^{n^{1/3}} 2n1/3
    easy problem: their solutions are efficient
    hard problem: their solutions are inefficient
    complexity classes: classify problems
    P: stands for Polynomial-Time
    Matchmaking in the “stable marriage problem.”
    Determining if a number is prime
    Linear programming
    NP:
    Factoring
    Testing if two networks are equivalent
    NP-COMPLETE:If we can find an efficient solution to any NP COMPLETE, then we can use it to find an efficient solution to any NP problem.
    Solving n×n Sudoku puzzles.
    traveling salesman problem.
    Hamiltonian path problem.
    bin packing problem.
    PSPACE :contains all the problems that can be solved by a computer using a polynomial amount of memory, without any limits on time.
    Determining whether a winning strategy exists for the game of checkers generalised to an n×n board.
    Winning a generalized level of Super Mario Bros.
    关系图

1.8 Turing Machines

Turing machine is another types of computers, or models of computation.

  1. Components
    Turing machines can compute everything that a circuit-based computer can compute. But, they are easier to describe mathematically.
    turning machine
    • A tape divided into cells, each with a symbol from some finite alphabet.
    • A head that can read or write to the tape, and then move left one cell (←), right
    one cell (→), or stay put (•).
    • A register that stores the state of the Turing machine.
    • A list of instructions or program.
  2. Incrementing Binary Numbers
    Turning machine 做加法的流程。
  3. Church-Turing Thesis
    • The Church-Turing Thesis: everything that is computable can be computed with a Turing machine, although it could take a long time
    undecidable problems: problems that cannot be computed
    • Strong Church-Turing Thesis: any model of computation, be it the circuit model or something else, can be simulated by a probabilistic Turing machine with at most polynomial overhead.
    An efficient algorithm on one kind of computer is also an efficient algorithm on a probabilistic Turing machine, since adding a polynomial overhead to a polynomial time algorithm is still a polynomial time algorithm.
    • Why quantum computer
    what is impossible to compute remains impossible.(没有违反The Church-Turing Thesis)
    But it will efficiently solve problems that are inefficient on classical computers.(违反了Strong Church-Turing Thesis
    Evidence
    ①Quantum computers can efficiently factor numbers using Shor’s algorithm
    ②Determining the results of random quantum programs is called random circuit
    sampling.
    ③boson sampling
    BQP

• BQP: problems efficiently solved by a quantum computer

信道编码是一种常用的数据传输技术,旨在增强数据传输的可靠性和效率。它用于解决数据在传输过程中受到干扰和噪声引起的错误问题。信道编码可以分为经典信道编码和现代信道编码两种类型。 经典信道编码是指早期使用的一些基本编码方法,例如重复码、奇偶校验码等。这些编码方法比较简单且易于实现,但容错能力有限,并且对数据传输速率有一定的限制。其中最常见的是奇偶校验码,它通过在每个数据块中添加一位校验位来判断数据是否传输正确。 现代信道编码采用更复杂的编码方法来提高数据传输的可靠性和效率。常用的现代信道编码方法有海明码、卷积码和LDPC码等。这些编码方法可以通过在数据中添加冗余信息,使得接收方在接收到带有一定错误的数据时,能够通过纠正和检测错误来恢复原始数据。 海明码是一种经典的现代信道编码方法,它通过在数据中添加校验位,使得接收方可以检测和纠正单位错误。卷积码是一种基于状态机的编码方法,通过添加冗余信息来提高数据传输可靠性。LDPC码是一种低密度奇偶校验码,它通过建立校验矩阵来提高数据传输的可靠性。 总的来说,经典信道编码和现代信道编码在数据传输过程中起到了不同的作用。经典信道编码简单且易于实现,适用于低速率的数据传输。而现代信道编码更加复杂,具有更强的纠错能力和适用性,适用于高速、高可靠性的数据传输。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值