Skip to content

Commit

Permalink
Merge pull request #116 from beizhansl/master
Browse files Browse the repository at this point in the history
Eliminate dependence of qfvm
  • Loading branch information
beizhansl committed Nov 23, 2023
2 parents 07ff991 + e0c9501 commit 66ba1af
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
16 changes: 15 additions & 1 deletion quafu/simulators/default_simulator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# default circuit simulator for state vector
# (C) Copyright 2023 Beijing Academy of Quantum Information Sciences
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""default circuit simulator for state vector"""

from typing import Iterable, List, Union
from quafu.circuits.quantum_circuit import QuantumCircuit
Expand Down
19 changes: 17 additions & 2 deletions quafu/simulators/simulator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# (C) Copyright 2023 Beijing Academy of Quantum Information Sciences
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""simulator for quantum circuit and qasm"""

from typing import Union
from .default_simulator import py_simulate, ptrace, permutebits
from .qfvm import simulate_circuit
from quafu import QuantumCircuit
from ..results.results import SimuResult
import numpy as np
Expand Down Expand Up @@ -62,7 +77,7 @@ def simulate(
values = list(range(num))

count_dict = None

from .qfvm import simulate_circuit
# simulate
if simulator == "qfvm_circ":
if use_gpu:
Expand Down

0 comments on commit 66ba1af

Please sign in to comment.