VQEBuilder
Source code in q3as/algo/vqe.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
ansatz(qc)
Set the ansatz to use for the VQE. This can either be a QuantumCircuit or a callback that takes the observables as argument and returns a QuantumCircuit. This defaults to the EfficientSU2 ansatz.
Source code in q3as/algo/vqe.py
app(app)
build()
Build the VQE instance
Source code in q3as/algo/vqe.py
initial_params(params)
Set the initial parameters of the ansatz. If no parameters are given, the initial parameters are set to 0.
maxiter(maxiter)
observables(obs)
Set the observables to estimate. E.g. the Hamiltonian of the system. If no observables are given, the Hamiltonian of the application is used
Source code in q3as/algo/vqe.py
optimizer(opt)
run(estimator, sampler=None, callback=None)
Run the VQE