[Qiskit] 單量子位元閘(Single Qubit Gates)
在前一篇文章,我們了解了一個量子位元可能的機率狀態。我們將把量子位元表達成二維向量,並限制寫成以下格式。
Read More »[Qiskit] 單量子位元閘(Single Qubit Gates)在前一篇文章,我們了解了一個量子位元可能的機率狀態。我們將把量子位元表達成二維向量,並限制寫成以下格式。
Read More »[Qiskit] 單量子位元閘(Single Qubit Gates)You are given an array of n
strings strs
, all of the same length.
Given a directed acyclic graph (DAG) of n
nodes labeled from 0
to n - 1
, find all possible paths from node 0
to node n - 1
and return them in any order.
You are given a 0-indexed integer array piles
, where piles[i]
represents the number of stones in the ith
pile, and an integer k
. You should apply the following operation exactly k
times:
You have n
bags numbered from 0
to n - 1
. You are given two 0-indexed integer arrays capacity
and rocks
. The ith
bag can hold a maximum of capacity[i]
rocks and currently contains rocks[i]
rocks. You are also given an integer additionalRocks
, the number of additional rocks you can place in any of the bags.
You are given an integer array nums
. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
You are given an array prices
where prices[i]
is the price of a given stock on the ith
day.
There are n
rooms labeled from 0
to n - 1
and all the rooms are locked except for room 0
. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.
前一個章節我們使用 Qiskit 實作了一個半加法器(Half Adder)。現在,我們已經知道了什麼是『位元』(bits)、以及傳統電腦的部分工作原理。
Read More »[Qiskit] 量子位元狀態的表示法There is a bi-directional graph with n
vertices, where each vertex is labeled from 0
to n - 1
(inclusive). The edges in the graph are represented as a 2D integer array edges
, where each edges[i] = [ui, vi]
denotes a bi-directional edge between vertex ui
and vertex vi
. Every vertex pair is connected by at most one edge, and no vertex has an edge to itself.