def variational_circuit(): # BUILD VARIATIONAL CIRCUIT HERE - START # import required qiskit libraries if additional libraries are required num_qubits = 5 # build the variational circuit var_circuit = RealAmplitudes(num_qubits, entanglement='full', reps=3) var_circuit.draw() # BUILD VARIATIONAL CIRCUIT HERE - END # return the variational circuit which is either a VaritionalForm or QuantumCircuit object return var_circuit # # the write_and_run function writes the content in this cell into the file "optimal_params.py"
def variational_circuit(): # BUILD VARIATIONAL CIRCUIT HERE - START # import required qiskit libraries if additional libraries are required num_qubits = 3 # build the variational circuit var_circuit = RealAmplitudes(num_qubits, entanglement='full', reps=3) var_circuit.draw() # BUILD VARIATIONAL CIRCUIT HERE - END # return the variational circuit which is either a VaritionalForm or QuantumCircuit object return var_circuit