Skip to content

Commit

Permalink
Addressing Ruslan's pull request comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgupt committed Jan 9, 2025
1 parent fd3e946 commit a754a40
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion qokit/dicke_state_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import math, numpy, scipy

# from qiskit.opflow import I, X, Y
from qiskit.quantum_info import Pauli

I = Pauli("I")
Expand Down
3 changes: 1 addition & 2 deletions qokit/portfolio_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ def portfolio_brute_force(po_problem: dict, return_bitstring=False) -> tuple[flo
return min_constrained, min_x, max_constrained, max_x, mean_constrained


def get_data(N, seed=1, real=True) -> tuple[float, float]:
def get_data(N, seed=1, real=False) -> tuple[float, float]:
"""
load portofolio data from qiskit-finance (Yahoo)
https://github.com/Qiskit/qiskit-finance/blob/main/docs/tutorials/11_time_series.ipynb
"""
import datetime

# from qiskit_finance.data_providers import RandomDataProvider, YahooDataProvider
from qokit.yahoo import YahooDataProvider

stock_symbols = [
Expand Down
1 change: 0 additions & 1 deletion qokit/qaoa_circuit_portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def measure_circuit(circuit, n_trials=1024, save_state=True):
return bitstrings
else:
backend = Aer.get_backend("statevector_simulator")
# result = transpile(circuit, backend).result()
circ = transpile(circuit, backend)
state = Statevector(circ)
return reverse_array_index_bit_order(state)
Expand Down
1 change: 0 additions & 1 deletion qokit/qaoa_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def compute_objective_from_probabilities(probabilities): # type: ignore

def g(gamma, beta):
qc = parameterized_circuit.assign_parameters(list(np.hstack([beta, gamma])))
# qc = parameterized_circuit.bind_parameters(list(np.hstack([beta, gamma])))
sv = np.asarray(backend.run(qc).result().get_statevector())
probs = np.abs(sv) ** 2
return compute_objective_from_probabilities(probs)
Expand Down

0 comments on commit a754a40

Please sign in to comment.