Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
doichanj committed Aug 15, 2024
1 parent 3ad2b6c commit e74a939
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions qiskit_aer/backends/unitary_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,43 +314,3 @@ def _execute_circuits(self, aer_circuits, noise_model, config):
config = map_legacy_method_config(config)
aer_circuits = add_final_save_op(aer_circuits, "unitary")
return cpp_execute_circuits(self._controller, aer_circuits, noise_model, config)
<<<<<<< HEAD
=======

def _validate(self, qobj):
"""Semantic validations of the qobj which cannot be done via schemas.
Some of these may later move to backend schemas.
1. Set shots=1
2. No measurements or reset
3. Check number of qubits will fit in local memory.
"""
name = self.name
if getattr(qobj.config, "noise_model", None) is not None:
raise AerError(f"{name} does not support noise.")

n_qubits = qobj.config.n_qubits
max_qubits = self.configuration()["n_qubits"]
if n_qubits > max_qubits:
raise AerError(
f"Number of qubits ({n_qubits}) is greater than "
f'max ({max_qubits}) for "{name}" with '
f"{int(psutil.virtual_memory().total / (1024**3))} GB system memory."
)
if qobj.config.shots != 1:
logger.info('"%s" only supports 1 shot. Setting shots=1.', name)
qobj.config.shots = 1
for experiment in qobj.experiments:
exp_name = experiment.header.name
if getattr(experiment.config, "shots", 1) != 1:
logger.info(
'"%s" only supports 1 shot. Setting shots=1 for circuit "%s".',
name,
exp_name,
)
experiment.config.shots = 1
for operation in experiment.instructions:
if operation.name in ["measure", "reset"]:
raise AerError(
f"Unsupported {name} instruction {operation.name} in circuit {exp_name}"
)
>>>>>>> upstream/main

0 comments on commit e74a939

Please sign in to comment.