Skip to content

Commit

Permalink
Pkg added, minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
harshangrjn committed Nov 3, 2022
1 parent f99cf5b commit 5d68580
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
QuantumCircuitOpt.jl Change Log
===============================

### v0.5.2
- Added dependency on `Pkg` package for logging purposes
- Renamed gates in `src/examples` folder

### v0.5.1
- New feature: Added support for compiling optimal circuits upto a global phase using linear constraints (`optimal_global_phase`)
- Deactivated determinant feasiblity check for global phase model
Expand Down
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name = "QuantumCircuitOpt"
uuid = "88128e30-b60a-4e54-ab02-1050a5f92a36"
authors = ["Harsha Nagarajan"]
version = "0.5.1"
version = "0.5.2"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[compat]
DataStructures = "~0.17, ~0.18"
JuMP = "~0.22, ~0.23, 1.0"
Memento = "~1.0, ~1.1, 1"
Pkg = "1.8"
julia = "^1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["HiGHS", "Test"]
8 changes: 4 additions & 4 deletions examples/2qubit_gates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function magic_using_SHCnot()
)
end

function S_gate()
function S_using_U3()

println(">>>>> S Gate <<<<<")

Expand Down Expand Up @@ -211,7 +211,7 @@ function swap()
)
end

function W_gate()
function W_using_U3()

println(">>>>> W Gate <<<<<")

Expand Down Expand Up @@ -260,7 +260,7 @@ function W_using_HCnot()
)
end

function HCoinGate()
function hadamard_coin()

println(">>>>> Hadamard Coin gate <<<<<")

Expand Down Expand Up @@ -374,7 +374,7 @@ function qft2_using_HT()
)
end

function GRGate()
function GR_using_R()
println(">>>>> GRGate testing <<<<<")

GR1 = QCOpt.get_full_sized_gate("GR", 2; angle =/6, π/3])
Expand Down
6 changes: 3 additions & 3 deletions examples/3qubit_gates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function toffoli_using_kronecker()
)
end

function toffoli_with_controlled_gates()
function toffoli_using_2qubit_gates()

# Reference: https://doi.org/10.1109/TCAD.2005.858352
println(">>>>> Toffoli gate with controlled gates <<<<<")
Expand Down Expand Up @@ -102,7 +102,7 @@ function CNot_1_3()
)
end

function FredkinGate()
function fredkin()

return Dict{String, Any}(
"num_qubits" => 3,
Expand All @@ -115,7 +115,7 @@ function FredkinGate()
)
end

function FredkinGate_using_SSwap()
function fredkin_using_SSwap()

return Dict{String, Any}(
"num_qubits" => 3,
Expand Down
8 changes: 4 additions & 4 deletions examples/decompose_all_gates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ decompose_gates = [
"magic",
"magic_using_CNOT_1_2",
"magic_using_SHCnot",
"S_gate",
"S_using_U3",
"revcnot",
"revcnot_with_U",
"swap",
"W_gate",
"W_using_U3",
"W_using_HCnot",
"GroverDiffusion_using_Clifford",
"GroverDiffusion_using_U3",
Expand All @@ -22,9 +22,9 @@ decompose_gates = [
"X_using_GR",
"CNOT_using_GR",
#-- 3-qubit gates --#
"toffoli_with_controlled_gates",
"toffoli_using_2qubit_gates",
"CNot_1_3",
"FredkinGate",
"fredkin",
"toffoli_left",
"toffoli_right",
"miller",
Expand Down
1 change: 0 additions & 1 deletion examples/optimizers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function get_ipopt()
"max_iter" => Int(1E4))
end


#=================================================================#
# Local mixed-integer nonlinear programming solver (open-source) #
#=================================================================#
Expand Down
2 changes: 1 addition & 1 deletion src/QuantumCircuitOpt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module QuantumCircuitOpt
import JuMP
import LinearAlgebra
import Memento
import Pkg

const LA = LinearAlgebra
const QCO = QuantumCircuitOpt
const kron_symbol = 'x'
const qubit_separator = '_'
const _QCOPT_VERSION = "v0.5.1"

# Create our module level logger (this will get precompiled)
const _LOGGER = Memento.getlogger(@__MODULE__)
Expand Down
2 changes: 1 addition & 1 deletion src/log.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function visualize_solution(results::Dict{String, Any}, data::Dict{String, Any};
if !isempty(gates_sol_compressed)

printstyled("\n","=============================================================================","\n"; color = _main_color)
printstyled("QuantumCircuitOpt version: ", _QCOPT_VERSION, "\n"; color = _header_color, bold = true)
printstyled("QuantumCircuitOpt version: ", Pkg.TOML.parse(read(string(pkgdir(QCO), "/Project.toml"), String))["version"], "\n"; color = _header_color, bold = true)

printstyled("\n","Quantum Circuit Model Data"; color = _header_color, bold = true)

Expand Down
2 changes: 1 addition & 1 deletion test/qc_model_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ end
"decomposition_type" => "exact_optimal"
)

model_options = Dict{Symbol, Any}(:time_limit => 1)
model_options = Dict{Symbol, Any}(:time_limit => 0.2)

result_qc = QCO.run_QCModel(params, MIP_SOLVER; options = model_options)
@test result_qc["termination_status"] == MOI.TIME_LIMIT
Expand Down

0 comments on commit 5d68580

Please sign in to comment.