match a {
0..10=> { println!("yes"); }
_ => { println!("no"); }
}
error[E0658]: exclusive range pattern syntax is experimental
--> src\main.rs:37:13
|
37 | 0..10 => { println!("yes"); }
| ^^^^^
|
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
error[E0030]: lower range bound must be less than or equal to upper
--> src/main.rs:5:14
|
5 | Some('a'..='Z') => { println!("yes"); }
| ^^^ lower bound larger than upper bound
defbernstein_vazirani(string):
# Save the length of string
string_length = len(string)
# Make a quantum circuit
qc = QuantumCircuit(string_length+1, string_length)
# Initialize each input qubit to apply a Hadamard gate and output qubit to |->for i inrange(string_length):
qc.h(i)
qc.x(string_length)
qc.h(string_length)
qc.barrier()
# Apply an oracle for the given string# Note: In Qiskit, numbers are assigned to the bits in a string from right to left
rev_string = string[::-1]
for i inrange(string_length):
if rev_string[i] == "1":
qc.cx(i, string_length)
qc.barrier()
# Apply Hadamard gates after querying the oraclefor i inrange(string_length):
qc.h(i)
# Measurement
qc.measure(range(string_length), range(string_length))
return qc
phases = np.linspace(0, 2*np.pi, 50) # Specify the range of parameters to look within 0 to 2pi with 50 different phases# Phases need to be expressed as list of lists in order to work
individual_phases = [[ph] for ph in phases]
Sampler を使い、パラメータ化された回路にパラメータをバインドする。以下が答え。
with Session(service=service, backend=backend):
sampler = Sampler(options=options)
job = sampler.run(circuits=[qc for _ inrange(50)], parameter_values=individual_phases)
result = job.result()
# Make hamiltonians using SparsePauliOp
H1 = SparsePauliOp.from_list([("IIZXI",1), ("YIIIY",3)])
H2 = SparsePauliOp.from_list([("IXIII",2)])
H3 = SparsePauliOp.from_list([("IIYII",3), ("IXIZI",5)])
【ステップ3】 numpy.linspace を使って theta の値を等間隔に作る。
# Make a list of evenly spaced values for theta between 0 and 1
theta1 = np.linspace(0, 1, n_qubit*(reps1+1))
theta2 = np.linspace(0, 1, n_qubit*(reps2+1))
theta3 = np.linspace(0, 1, n_qubit*(reps3+1))
# Let us first generate a graph with 4 nodes!#### enter your code below ####
n = 4
num_qubits = n**2#### enter your code above ####
tsp = Tsp.create_random_instance(n, seed=123)
adj_matrix = nx.to_numpy_matrix(tsp.graph)
print("distance\n", adj_matrix)
colors = ["r"for node in tsp.graph.nodes]
pos = [tsp.graph.nodes[node]["pos"] for node in tsp.graph.nodes]
draw_graph(tsp.graph, colors, pos)
from qiskit_optimization.converters import QuadraticProgramToQubo
#### enter your code below ####
qp2qubo = QuadraticProgramToQubo() #instatiate qp to qubo class
qubo = qp2qubo.convert(qp) # convert quadratic program to qubo
qubitOp, offset = qubo.to_ising() #convert qubo to ising#### enter your code above ####print("Offset:", offset)
print("Ising Hamiltonian:", str(qubitOp))
from qiskit import QuantumRegister, ClassicalRegister
from qiskit.circuit import ParameterVector, QuantumCircuit
# Initialize circuit
qr = QuantumRegister(3)
cr = ClassicalRegister(3)
circuit = QuantumCircuit(qr,cr)
# Initialize Parameter with θ
theta = ParameterVector('θ', 2)
#### enter your code below ##### Apply gates to circuit
circuit.x(0)
circuit.ry(theta[0], 1)
circuit.cz(0,1)
circuit.ry(-theta[0], 1)
circuit.ry(theta[1], 2)
circuit.cz(1,2)
circuit.ry(-theta[1], 2)
circuit.cx(1,0)
circuit.cx(2,1)
#### enter your code above ####
circuit.measure(qr,cr)
circuit.draw("mpl")
Exercise 4
from qiskit_ibm_runtime import Session, Sampler, Options
options = Options(simulator={"seed_simulator": 42},resilience_level=0) #DO NOT CHANGE#### Enter your code below ##### Define sampler objectwith Session(service=service, backend=backend):
pvs = [[(54.73/360)*(2*np.pi), (45/360)*(2*np.pi)]]
sampler = Sampler(options=options) # Define sampler with options above
result = sampler.run(circuits=[circuit], parameter_values=pvs, shots=5000).result() # Run the sampler. Remember, the theta here is in degrees! :) # Plot result
result_dict = result.quasi_dists[0] # Obtain the quasi distribution. Note: Expected result type: QuasiDistribution dict#### Enter your code above ####
values = list(result_dict.keys()) # Obtain all the values in a list
probabilities = list(result_dict.values()) # Obtain all the probabilities in a list
plt.bar(values,probabilities,tick_label=values)
plt.show()
print(result_dict)
from qiskit import QuantumRegister, ClassicalRegister
from qiskit.circuit import ParameterVector, QuantumCircuit
deftsp_entangler(N):
# Define QuantumCircuit and ParameterVector size
circuit = QuantumCircuit(N**2)
theta = ParameterVector('theta',length=(N-1)*N)
############# # Hint: One of the approaches that you can go for is having an outer `for` loop for each node and 2 inner loops for each block. /# Continue on by applying the same routine as we did above for each node with inner `for` loops for /# the ry-cz-ry routine and cx gates. Selecting which indices to apply for the routine will be the /# key thing to solve here. The indices will depend on which parameter index you are checking for and the current node! /# Reference solution has one outer loop for nodes and one inner loop each for rz-cz-ry and cx gates respectively.############# #### enter your code below ####
theta_i = 0for i inrange(N):
# X Gate
circuit.x(i*N)
# Parameter Gatesfor j inrange(i*N+1, i*N+N):
circuit.ry(theta[theta_i], j)
circuit.cz(j-1, j)
circuit.ry(-theta[theta_i], j)
theta_i += 1# CX gatesfor j inrange(i*N+1, i*N+N):
circuit.cx(j, j-1)
#### enter your code above ####return circuit
%%time
# Do not change the code below and use the given seeds for successful gradingfrom qiskit.utils import algorithm_globals
from qiskit.primitives import Estimator
algorithm_globals.random_seed = 123# Define optimizer
optimizer = SPSA(maxiter=50)
# Define Initial point
np.random.seed(10)
init = np.random.rand((n-1)*n) * 2 * np.pi
# Define backend
backend = service.backends(simulator=True)[0]
#### Enter your code below ##### Call RunVQEwith Session(service = service, backend = backend):
estimator = Estimator()
result, mean = RunVQE(estimator=estimator, model=PQC, optimizer=optimizer, operator=qubitOp, init=init) #----# Enter your code here. Do not pass in options)#### Enter your code above ##### Print resultprint(result)
defBestBitstring(result, optimal_circuit):
energy = result.eigenvalue.real
options = Options(simulator={"seed_simulator": 42},resilience_level=0) # Do not change and please pass it in the Sampler call for successful grading#### enter your code below ####with Session(service = service, backend = backend):
# Enter your code here. Please do pass in options in the Sampler construct.
sampler = Sampler(options=options)
job = sampler.run(circuits=[optimal_circuit], parameter_values=[list(result.optimal_parameters.values())])
sampler_result = job.result()
# Obtain the nearest_probability_distribution for the sampler result from the quasi distribution obtained
result_prob_dist = sampler_result.quasi_dists[0].nearest_probability_distribution()
#### enter your code above ####
max_key = format(max(result_prob_dist, key = result_prob_dist.get),"016b")
result_bitstring = np.array(list(map(int, max_key)))
return energy, sampler_result, result_prob_dist, result_bitstring
Exercise 8
N=3 の model_3(論文から引用)
一般化よくわかんなかったです👽。
n = 3
model_3 = QuantumCircuit(n**2)
theta = ParameterVector('theta',length=(n-1)*n//2)
# Build a circuit when n is 2
model_3.x(0)
model_3.x(6)
# Apply a parameterized W state gate
model_3.ry(theta[0],1)
model_3.cz(0,1)
model_3.ry(-theta[0],1)
model_3.cx(1,0)
model_3.cx(1,3)
model_3.cx(0,4)
model_3.ry(theta[1],7)
model_3.cz(6,7)
model_3.ry(-theta[1],7)
model_3.ry(theta[2],8)
model_3.cz(7,8)
model_3.ry(-theta[2],8)
model_3.cx(7,6)
model_3.cx(8,7)
# Apply 4 CSWAP gates
model_3.cswap(6,0,2)
model_3.cswap(6,5,3)
model_3.cswap(7,1,2)
model_3.cswap(7,4,5)
model_3.draw("mpl")
Exercise 9
4ノードでVQE解を求めよという問題。いままで作った関数を駆使して実装する。
QUBO は以下の通り。
#### Enter your code below ####
qp = tsp.to_quadratic_program()
qp2qubo = QuadraticProgramToQubo()
qubo = qp2qubo.convert(qp)
qubitOp_4, _ = qubo.to_ising()
#### Enter your code above ####
#### Fill in the values below and complete the function to define the Molecule ##### Coordinates are given in Angstrom# value = 0.791513 / 3**(1/2) # 0.4569802436170883
value = 0.456980
hydrogen_t = [["H", [value, 0.0, 0.0]], # ----------- Enter your code here
["H", [-value, 0.0, 0.0]], # ----------- Enter your code here
["H", [0.0, 0.791513, 0.0]]]
h3p = Molecule( # Fill up the function below
geometry=hydrogen_t, # ----------- Enter your code here
multiplicity=1, # ----------- Enter your code here
charge=1, # ----------- Enter your code here
)
driver = ElectronicStructureMoleculeDriver(h3p, basis="ccpvdz", driver_type=ElectronicStructureDriverType.PYSCF)
properties = driver.run()
%%time
from qiskit.utils import algorithm_globals
algorithm_globals.random_seed = 1024# Define convergence list
convergence = []
# Keep track of jobs (Do-not-modify)
job_list = []
# Initialize estimator object
estimator = Estimator()# Enter your code here# Define evaluate_expectation functiondefevaluate_expectation(x):
x = list(x)
# Define estimator run parameters#### enter your code below ##### job = estimator.run(circuits=[ansatz], observables=[qubit_op_parity], parameter_values=[x]) # PrimitiveJob ではなく、EstimatorResultを入れる
job = estimator.run(circuits=[ansatz], observables=[qubit_op_parity], parameter_values=[x]).result() # ----------- Enter your code here
results = job.values[0]
job_list.append(job)
# Pass results back to callback functionreturn np.real(results)
# Call back functiondefcallback(x,fx,ax,tx,nx):
# Callback function to get a view on internal states and statistics of the optimizer for visualization
convergence.append(evaluate_expectation(fx))
np.random.seed(10)
# Define initial point. We shall define a random point here based on the number of parameters in our ansatz
initial_point = np.random.random(ansatz.num_parameters)
#### enter your code below ##### Define optimizer and pass callback function
optimizer = SPSA(maxiter=50, callback=callback) # ----------- Enter your code here# Define minimize function
result = optimizer.minimize(fun=evaluate_expectation, x0=initial_point) # ----------- Enter your code here
Exercise 3
construct_problem は以下。
defconstruct_problem(geometry, charge, multiplicity, basis, num_electrons, num_molecular_orbitals):
molecule = Molecule(geometry=geometry,
charge=charge,
multiplicity=multiplicity)
driver = ElectronicStructureMoleculeDriver(molecule, basis=basis, driver_type=ElectronicStructureDriverType.PYSCF)
# Run the preliminary quantum chemistry calculation
properties = driver.run()
# Set the active space
active_space_trafo = ActiveSpaceTransformer(num_electrons=num_electrons,
num_molecular_orbitals=num_molecular_orbitals)
# Now you can get the reduced electronic structure problem
problem_reduced = ElectronicStructureProblem(driver, transformers=[active_space_trafo]) # ----------- Enter your code here# The second quantized Hamiltonian of the reduce problem
second_q_ops_reduced = problem_reduced.second_q_ops()
# Set the mapper to qubits
parity_mapper = ParityMapper() # This is the example of parity mapping# Set the qubit converter with two qubit reduction to reduce the computational cost
parity_converter = QubitConverter(parity_mapper) # ----------- Enter your code here # Compute the Hamitonian in qubit form
qubit_op_parity = parity_converter.convert(second_q_ops_reduced.get('ElectronicEnergy'), num_particles=problem_reduced.num_particles)
# Get reference solution
vqe_factory = VQEUCCFactory(quantum_instance=StatevectorSimulator(),optimizer=SLSQP(),ansatz=UCC(excitations='sd'))
solver = GroundStateEigensolver(parity_converter, vqe_factory)
real_solution = solver.solve(problem_reduced).total_energies[0]
ansatz=vqe_factory.ansatz
return ansatz, qubit_op_parity, real_solution, problem_reduced
custom_vqe は以下。
defcustom_vqe(estimator, ansatz, ops, problem_reduced, optimizer = None, initial_point=None):
# Define convergence list
convergence = []
# Keep track of jobs (Do-not-modify)
job_list = []
# Define evaluate_expectation functiondefevaluate_expectation(x):
x = list(x)
# Define estimator run parameters
job = estimator.run(circuits=[ansatz], observables=[ops], parameter_values=[x]).result() # ----------- Enter your code here
results = job.values[0]
job_list.append(job)
# Pass results back to callback functionreturn np.real(results)
# Call back functiondefcallback(x,fx,ax,tx,nx):
# Callback function to get a view on internal states and statistics of the optimizer for visualization
convergence.append(evaluate_expectation(fx))
np.random.seed(10)
# Define initial point. We shall define a random point here based on the number of parameters in our ansatzif initial_point isNone:
initial_point = np.random.random(ansatz.num_parameters)
# Define optimizer and pass callback functionif optimizer == None:
optimizer = SPSA(maxiter=50, callback=callback)
# Define minimize function
result = optimizer.minimize(fun=evaluate_expectation, x0=initial_point) # ----------- Enter your code here
vqe_interpret = []
for i inrange(len(convergence)):
sol = MinimumEigensolverResult()
sol.eigenvalue = convergence[i]
sol = problem_reduced.interpret(sol).total_energies[0]
vqe_interpret.append(sol)
return vqe_interpret, job_list, result
grade_lab4_ex3b は、grade_lab4_ex に修正する。
## Grade and submit your solutionfrom qc_grader.challenges.fall_2022 import grade_lab4_ex3
grade_lab4_ex3(construct_problem, custom_vqe)
K_H2eV = 27.2113845# Hartree -> eV# calculate reaction energy.
before_energy = (Energy_H_m[-1] + Energy_H_c[-1])
after_energy = (Energy_H_t[-1] + Energy_H_a[-1])
react_energy = after_energy - before_energy
react_vqe_ev = react_energy * K_H2eV # Fill this cell. Please note the reaction energy should be in eV and not in Hartree units for succesful grading.print("Reaction energy VQE estimator eV", react_vqe_ev ,"\n")
%%time
# Extracting solved initial point from one shot estimation done previously
initial_pt = result.raw_result.optimal_point
# List to store all estimated observables
uccsd_result = []
#### Enter your code below ####for i inrange(7):
uccsd_result.append(Estimator().run(circuits=[vqe_factory.ansatz], observables=[qubit_op_parity[i]], parameter_values=[initial_pt]).result())
#### Enter your code above ####
energy_c_estimator=uccsd_result[0].values[0]+result.extracted_transformer_energy+result.nuclear_repulsion_energy
print('Energy = ', energy_c_estimator)
# Fill your codes here, dipole moment computed by Nuclear dipole moment - Electronic dipole moment # and Electronic dipole moment computed by adding VQE reult and ctiveSpaceTransformer extracted energy part
dipxau = uccsd_result[4].values[0] + temp_dipoles[0] - temp_nu_dipoles[0] # ----------- Enter your code here (Use Partial information in element 4 in uccsd_result list)
dipyau = uccsd_result[5].values[0] + temp_dipoles[1] - temp_nu_dipoles[1] # ----------- Enter your code here (Use Partial information in element 5 in uccsd_result list)
dipzau = uccsd_result[6].values[0] + temp_dipoles[2] - temp_nu_dipoles[2] # ----------- Enter your code here (Use Partial information in element 6 in uccsd_result list)
au2debye = 1/0.393430307# Convert to debye
dipxdebye = dipxau.real * au2debye
dipydebye = dipyau.real * au2debye
dipzdebye = dipzau.real * au2debye
dip_tot = (dipxdebye**2 + dipydebye**2 + dipzdebye**2)**(1/2) # Compute the total dipole moment magnitude here from the individual components of the vector computed above.print('Dipole (debye) : ', dip_tot)
deflab1_ex7(n:int) -> int:
#Here we want you to build a function calculating the number of gates needed by the fourier rotation for n qubits.
numberOfGates=0## FILL YOUR CODE IN HERE# TRY TO FIND AN EXPLIZIT (NON RECURSIVE) FUNCTION## 等差数列の和の公式を使う
numberOfGates = (n-1)*n//2 + n
return numberOfGates
lab1_ex8
量子回路の深さは浅いほどよい。 を深さ5で作るには、どうすればよいかという問題。
H(0)
CX(0,1)
CX(0,2), CX(1,3)
CX(0,4), CX(1,5), CX(2,6), CX(3,7)
...
という風にやれば深さ5で作れる。
deflab1_ex8():
qc = QuantumCircuit(16) #Same as above#Step 1: Preparing the first qubit in superposition
qc.h(0)
### FILL YOUR CODE IN HERE#
N = 16
c_end = 1
is_end = Falsewhile1:
if is_end:
breakfor i inrange(0, c_end):
if i+c_end == N:
is_end = Truebreak
qc.cx(i, i+c_end)
c_end *= 2return qc
# Define a parameter t for the time in the time evolution operator
t = Parameter('t')
# Follow the instructions above to define a time-evolution operator###INSERT CODE BELOW THIS LINE# time_evolution_operator = (H).exp_i() # Wrong answar but pass.
time_evolution_operator = (H*t).exp_i()
###DO NOT EDIT BELOW THIS LINEprint(time_evolution_operator)
# Define the number of steps needed to reach the previously set total time-evolution
steps = int(evolution_time/time_step_value)
# Compose the operator for a Trotter step several times to generate the # operator for the full time-evolution###INSERT CODE BELOW THIS LINE
total_time_evolution_operator = I
for i inrange(steps):
total_time_evolution_operator @= time_evolution_operator
pt_evo = PauliTrotterEvolution()
total_time_evolution_circuit = pt_evo.convert(total_time_evolution_operator)
total_time_evolution_circuit = total_time_evolution_circuit.bind_parameters({t: time_step_value})
###DO NOT EDIT BELOW THIS LINEprint(total_time_evolution_circuit)
# Set number of qubits
num_qubits = 3# Define time parameter
t = Parameter('t')
# Set total evolution time
evolution_time_t = 2# Set size of time-step for Trotter evolution
time_step_value_t = 0.1# Define the number of steps
steps_t = int(evolution_time_t/time_step_value_t)
# Create circuit
tight_binding_circuit = QuantumCircuit(num_qubits)
# Add initial state preparation
tight_binding_circuit.x(0)
# Define the Hamiltonian, the time-evolution operator, the Trotter step and the total evolution###INSERT CODE BELOW THIS LINE# ハミルトニアン作成
H = (I^X^X) + (X^X^I) + (I^Y^Y) + (Y^Y^I)
# H = (X^X^I) + (I^X^X) + (I^Y^Y) + (Y^Y^I) # トロッター化は近似的な手法なので、ハミルトニアンの項の順序が異なると結果も若干違ってくる# 時間発展オペレーター作成
time_evo_op = (H*t).exp_i()
full_time_evo_op = I
for i inrange(steps_t):
full_time_evo_op @= time_evo_op
# PauliTrotterEvolutionを使って全体の時間発展
pt_evo = PauliTrotterEvolution()
exp_circuit = pt_evo.convert(full_time_evo_op)
bind_exp_circuit = exp_circuit.bind_parameters({t: time_step_value_t})
# 回路を合体
full_time_evolution_circuit = tight_binding_circuit.compose(bind_exp_circuit.to_circuit())
###DO NOT EDIT BELOW THIS LINEprint(full_time_evolution_circuit)
# Define a Gaussian function for the fitdefgaussian(x, a, mean, sigma):
return a * (1/(sigma*np.sqrt(2*np.pi)))*np.exp(-((x - mean)**2 / (2 * sigma**2)))
# Set initial estimates for the fit: the maximum height of the histogram, the theoretical# average and the theoretical standard deviation
height_estimate = np.max(yh)
mu_estimate = 0.5
sigma_estimate = np.sqrt(mu_estimate*(1-mu_estimate)/num_shots)
# Define list to store the estimated values of the average (mu_sigma[0]) and standard deviation (mu_sigma[1])
mu_sigma = []
# Use the curve_fit function to fit the experimental data using the definition of the Gaussian function# which will return the estimate of the parameters.###INSERT CODE BELOW THIS LINE
popt, pcov = curve_fit(gaussian, x_01_h, yh, [height_estimate, mu_estimate, sigma_estimate]) # popt:推定値, pcov: 共分散
mu_sigma = [0]*2
mu_sigma[0] = mu_estimate
mu_sigma[1] = sigma_estimate
###DO NOT EDIT BELOW THIS LINE print("The mean is ", mu_sigma[0])
print("The standard deviation is ", mu_sigma[1])
# Plot experimental data and the fit
plt.scatter(x_01_h, yh, label = 'data', color = 'red')
plt.plot(x_01, gaussian(x_01, *popt), label = 'fit', linestyle = '--')
plt.title(f"Using {num_shots} shots to estimate probability")
plt.xlim((0, 1))
plt.xlabel(r'probability of $\vert 0 \rangle$')
plt.ylabel('counts')
plt.legend()
plt.show()
# Define the confusion matrix from the probabilities found above###INSERT CODE BELOW THIS LINE
confusion_matrix = np.array([np.array([0.0for _ inrange(2)]) for __ inrange(2)])
confusion_matrix[0][0] = p0_0
confusion_matrix[0][1] = p0_1
confusion_matrix[1][0] = p1_0
confusion_matrix[1][1] = p1_1
###DO NOT EDIT BELOW THIS LINEprint("Confusion matrix:")
print(confusion_matrix)
# Invert the confusion matrix
inverse_confusion_matrix = np.linalg.inv(confusion_matrix)
# Mitigate the counts using the inverse of the confusion matrix###INSERT CODE BELOW THIS LINE
p_vector_mitigated = inverse_confusion_matrix.dot(p_vector_noisy)
###DO NOT EDIT BELOW THIS LINEprint("Mitigated probability of |0>: ", p_vector_mitigated[0])
print("Mitigated probability of |1>: ", p_vector_mitigated[1])
# Set value of rotation
theta = np.pi
# Instantiate a quantum circuit
circuit = qiskit.QuantumCircuit(quantum_register, classical_register)
# Add a parametrized RX rotation and bind the value of the parameter. (By default, parameter binding is not an in-place operation)# Then measure the qubit and calculate probability of seeing |0> after rx(np.pi) ###INSERT CODE BELOW THIS LINE
circuit.rx(theta, 0)
circuit.measure(0,0)
###DO NOT EDIT BELOW THIS LINE
grade_lab3_ex11
インコヒーレントノイズ(Incoherent Noise)の話。
「非干渉ノイズ」とでも訳すのだろうか。何も操作をしない id ゲート(idle操作)でも、ノイズの影響を受けるらしい。
# Define number of shots
num_shots_inchoherent = 10000# Create an empty noise model
depolarizing_noise_model = NoiseModel()
# Define a depolarizing error on the identity gate for qubit zero and add it to the noise model###INSERT CODE BELOW THIS LINE
error = depolarizing_error(0.05, 1)
depolarizing_noise_model.add_quantum_error(error, ["id"], qubits=[0])
###DO NOT EDIT BELOW THIS LINE
# Returns the XXX Heisenberg model for 3 spin-1/2 particles in a linedefex1_compute_H_heis3():
# FILL YOUR CODE IN HERE
H = (I^X^X)+(X^X^I)+(I^Y^Y)+(Y^Y^I)+(I^Z^Z)+(Z^Z^I)
# Return Hamiltonianreturn H
# Returns the time evolution operator U_heis3(t) for a given time t assuming an XXX Heisenberg Hamiltonian for 3 spins-1/2 particles in a linedefex2_compute_U_heis3(t):
# FILL YOUR CODE IN HERE
H = ex1_compute_H_heis3()
U = (H*t).exp_i()
return U
grade_lab4_ex3
時間発展演算子ができたので、量子系の任意の状態がどのように変化するかをシミュレーションできるようになった。XXX Heisenberg spin model を古典的にシミュレートしてとりあえず終了。
ibmq_manilaのエラー率の調べ方は、 IBM Quantumに行き、左上のメニューから「Compute Resources」をクリックすると各ibmqの資源情報が見れる。そこの検索バーに「manila」と入力し、ibmq_manilaをクリックすると詳細が出てくる。「Table view」にそれっぽい情報があるので、これを参考にノイズを作ればいいと思う。