tequila-basic 1.8.9__py3-none-any.whl → 1.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tequila/circuit/_gates_impl.py +42 -9
- tequila/circuit/gates.py +98 -64
- tequila/grouping/fermionic_functions.py +77 -16
- tequila/grouping/fermionic_methods.py +5 -2
- tequila/hamiltonian/paulis.py +1 -1
- tequila/optimizers/optimizer_gd.py +2 -1
- tequila/quantumchemistry/orbital_optimizer.py +13 -7
- tequila/quantumchemistry/pyscf_interface.py +11 -17
- tequila/quantumchemistry/qc_base.py +29 -7
- tequila/simulators/simulator_cirq.py +15 -25
- tequila/version.py +2 -2
- {tequila_basic-1.8.9.dist-info → tequila_basic-1.9.1.dist-info}/METADATA +16 -5
- {tequila_basic-1.8.9.dist-info → tequila_basic-1.9.1.dist-info}/RECORD +16 -16
- {tequila_basic-1.8.9.dist-info → tequila_basic-1.9.1.dist-info}/WHEEL +1 -1
- {tequila_basic-1.8.9.dist-info → tequila_basic-1.9.1.dist-info}/LICENSE +0 -0
- {tequila_basic-1.8.9.dist-info → tequila_basic-1.9.1.dist-info}/top_level.txt +0 -0
tequila/circuit/_gates_impl.py
CHANGED
@@ -6,7 +6,7 @@ from tequila.utils.exceptions import TequilaException
|
|
6
6
|
from tequila.objective.objective import Variable, FixedVariable, assign_variable
|
7
7
|
from tequila.hamiltonian import PauliString, QubitHamiltonian, paulis
|
8
8
|
from tequila.tools import list_assignment
|
9
|
-
|
9
|
+
import numpy as np
|
10
10
|
|
11
11
|
from dataclasses import dataclass
|
12
12
|
|
@@ -234,12 +234,12 @@ class DifferentiableGateImpl(ParametrizedGateImpl):
|
|
234
234
|
if r is None:
|
235
235
|
r = self.eigenvalues_magnitude
|
236
236
|
|
237
|
-
s = pi / (4 * r)
|
237
|
+
s = np.pi / (4 * r)
|
238
238
|
if self.is_controlled() and not self.assume_real:
|
239
239
|
# following https://arxiv.org/abs/2104.05695
|
240
240
|
shifts = [s, -s, 3 * s, -3 * s]
|
241
|
-
coeff1 = (sqrt(2) + 1)/sqrt(8) * r
|
242
|
-
coeff2 = (sqrt(2) - 1)/sqrt(8) * r
|
241
|
+
coeff1 = (np.sqrt(2) + 1)/np.sqrt(8) * r
|
242
|
+
coeff2 = (np.sqrt(2) - 1)/np.sqrt(8) * r
|
243
243
|
coefficients = [coeff1, -coeff1, -coeff2, coeff2]
|
244
244
|
circuits = []
|
245
245
|
for i, shift in enumerate(shifts):
|
@@ -344,7 +344,7 @@ class PowerGateImpl(ParametrizedGateImpl):
|
|
344
344
|
|
345
345
|
@property
|
346
346
|
def power(self):
|
347
|
-
return self.parameter/pi
|
347
|
+
return self.parameter/np.pi
|
348
348
|
|
349
349
|
def __init__(self, name, generator: QubitHamiltonian, target: list, power, control: list = None):
|
350
350
|
if generator is None:
|
@@ -353,7 +353,7 @@ class PowerGateImpl(ParametrizedGateImpl):
|
|
353
353
|
if name is None:
|
354
354
|
assert generator is not None
|
355
355
|
name = str(generator)
|
356
|
-
super().__init__(name=name, parameter=power * pi, target=target, control=control, generator=generator)
|
356
|
+
super().__init__(name=name, parameter=power * np.pi, target=target, control=control, generator=generator)
|
357
357
|
|
358
358
|
|
359
359
|
class GeneralizedRotationImpl(DifferentiableGateImpl):
|
@@ -376,11 +376,44 @@ class GeneralizedRotationImpl(DifferentiableGateImpl):
|
|
376
376
|
targets += [k for k in ps.keys()]
|
377
377
|
return tuple(set(targets))
|
378
378
|
|
379
|
-
def __init__(self, angle, generator, control=None, eigenvalues_magnitude=0.5, steps=1, assume_real=False):
|
380
|
-
|
379
|
+
def __init__(self, angle, generator, p0=None, control=None, target=None, eigenvalues_magnitude=0.5, steps=1, name="GenRot", assume_real=False):
|
380
|
+
if target == None:
|
381
|
+
target = self.extract_targets(generator)
|
382
|
+
super().__init__(eigenvalues_magnitude=eigenvalues_magnitude, generator=generator, assume_real=assume_real, name=name, parameter=angle, target=target, control=control)
|
381
383
|
self.steps = steps
|
382
|
-
|
384
|
+
if control is None and p0 is not None:
|
385
|
+
# augment p0 for control qubits
|
386
|
+
# Qp = 1/2(1+Z) = |0><0|
|
387
|
+
p0 = p0*paulis.Qp(control)
|
388
|
+
self.p0 = p0
|
389
|
+
|
390
|
+
def shifted_gates(self):
|
391
|
+
if not self.assume_real:
|
392
|
+
# following https://arxiv.org/abs/2104.05695
|
393
|
+
s = 0.5 * np.pi
|
394
|
+
shifts = [s, -s, 3 * s, -3 * s]
|
395
|
+
coeff1 = 0.25 * (np.sqrt(2) + 1)/np.sqrt(2)
|
396
|
+
coeff2 = 0.25 * (np.sqrt(2) - 1)/np.sqrt(2)
|
397
|
+
coefficients = [coeff1, -coeff1, -coeff2, coeff2]
|
398
|
+
circuits = []
|
399
|
+
for i, shift in enumerate(shifts):
|
400
|
+
shifted_gate = copy.deepcopy(self)
|
401
|
+
shifted_gate.parameter += shift
|
402
|
+
circuits.append((coefficients[i], shifted_gate))
|
403
|
+
return circuits
|
383
404
|
|
405
|
+
r = 0.25
|
406
|
+
s = 0.5*np.pi
|
407
|
+
|
408
|
+
Up1 = copy.deepcopy(self)
|
409
|
+
Up1._parameter = self.parameter+s
|
410
|
+
Up2 = GeneralizedRotationImpl(angle=s, generator=self.p0, eigenvalues_magnitude=r) # controls are in p0
|
411
|
+
Um1 = copy.deepcopy(self)
|
412
|
+
Um1._parameter = self.parameter-s
|
413
|
+
Um2 = GeneralizedRotationImpl(angle=-s, generator=self.p0, eigenvalues_magnitude=r) # controls are in p0
|
414
|
+
|
415
|
+
return [(2.0 * r, [Up1, Up2]), (-2.0 * r, [Um1, Um2])]
|
416
|
+
|
384
417
|
class ExponentialPauliGateImpl(DifferentiableGateImpl):
|
385
418
|
"""
|
386
419
|
Same convention as for rotation gates:
|
tequila/circuit/gates.py
CHANGED
@@ -361,10 +361,13 @@ def Rp(paulistring: typing.Union[PauliString, str], angle, control: typing.Union
|
|
361
361
|
return ExpPauli(paulistring=paulistring, angle=angle, control=control, *args, **kwargs)
|
362
362
|
|
363
363
|
|
364
|
+
def GenRot(*args, **kwargs):
|
365
|
+
return GeneralizedRotation(*args, **kwargs)
|
366
|
+
|
364
367
|
def GeneralizedRotation(angle: typing.Union[typing.List[typing.Hashable], typing.List[numbers.Real]],
|
365
368
|
generator: QubitHamiltonian,
|
366
369
|
control: typing.Union[list, int] = None,
|
367
|
-
eigenvalues_magnitude: float = 0.5,
|
370
|
+
eigenvalues_magnitude: float = 0.5, p0=None,
|
368
371
|
steps: int = 1, assume_real=False) -> QCircuit:
|
369
372
|
"""
|
370
373
|
|
@@ -393,6 +396,8 @@ def GeneralizedRotation(angle: typing.Union[typing.List[typing.Hashable], typing
|
|
393
396
|
list of control qubits
|
394
397
|
eigenvalues_magnitude
|
395
398
|
magnitude of eigenvalues, in most papers referred to as "r" (default 0.5)
|
399
|
+
p0
|
400
|
+
possible nullspace projector (if the rotation is happens in Q = 1-P0). See arxiv:2011.05938
|
396
401
|
steps
|
397
402
|
possible Trotterization steps (default 1)
|
398
403
|
|
@@ -403,7 +408,7 @@ def GeneralizedRotation(angle: typing.Union[typing.List[typing.Hashable], typing
|
|
403
408
|
|
404
409
|
return QCircuit.wrap_gate(
|
405
410
|
impl.GeneralizedRotationImpl(angle=assign_variable(angle), generator=generator, control=control,
|
406
|
-
eigenvalues_magnitude=eigenvalues_magnitude, steps=steps, assume_real=assume_real))
|
411
|
+
eigenvalues_magnitude=eigenvalues_magnitude, steps=steps, assume_real=assume_real, p0=p0))
|
407
412
|
|
408
413
|
|
409
414
|
|
@@ -473,7 +478,7 @@ def Trotterized(generator: QubitHamiltonian = None,
|
|
473
478
|
return QCircuit.wrap_gate(impl.TrotterizedGateImpl(generator=generator, angle=angle, steps=steps, control=control, randomize=randomize, **kwargs))
|
474
479
|
|
475
480
|
|
476
|
-
def SWAP(first: int, second: int, control: typing.Union[int, list] = None, power: float = None, *args,
|
481
|
+
def SWAP(first: int, second: int, angle: float = None, control: typing.Union[int, list] = None, power: float = None, *args,
|
477
482
|
**kwargs) -> QCircuit:
|
478
483
|
"""
|
479
484
|
Notes
|
@@ -486,10 +491,12 @@ def SWAP(first: int, second: int, control: typing.Union[int, list] = None, power
|
|
486
491
|
target qubit
|
487
492
|
second: int
|
488
493
|
target qubit
|
494
|
+
angle: numeric type or hashable type
|
495
|
+
exponent in the for e^{-i a/2 G}
|
489
496
|
control
|
490
497
|
int or list of ints
|
491
498
|
power
|
492
|
-
numeric type (fixed exponent) or hashable type (parametrized exponent)
|
499
|
+
numeric type (fixed exponent) or hashable type (parametrized exponent in the form (SWAP)^n
|
493
500
|
|
494
501
|
Returns
|
495
502
|
-------
|
@@ -498,12 +505,82 @@ def SWAP(first: int, second: int, control: typing.Union[int, list] = None, power
|
|
498
505
|
"""
|
499
506
|
|
500
507
|
target = [first, second]
|
508
|
+
if angle is not None:
|
509
|
+
assert power is None
|
510
|
+
angle = assign_variable(angle)
|
511
|
+
elif power is not None:
|
512
|
+
angle = assign_variable(power)*np.pi
|
501
513
|
generator = 0.5 * (paulis.X(target) + paulis.Y(target) + paulis.Z(target) - paulis.I(target))
|
502
|
-
if
|
514
|
+
if angle is None or power in [1, 1.0]:
|
503
515
|
return QGate(name="SWAP", target=target, control=control, generator=generator)
|
504
516
|
else:
|
505
|
-
return GeneralizedRotation(angle=
|
517
|
+
return GeneralizedRotation(angle=angle, control=control, generator=generator,
|
506
518
|
eigenvalues_magnitude=0.25)
|
519
|
+
|
520
|
+
|
521
|
+
def iSWAP(first: int, second: int, control: typing.Union[int, list] = None, power: float = 1.0, *args,
|
522
|
+
**kwargs) -> QCircuit:
|
523
|
+
"""
|
524
|
+
Notes
|
525
|
+
----------
|
526
|
+
iSWAP gate
|
527
|
+
.. math::
|
528
|
+
iSWAP = e^{i\\frac{\\pi}{4} (X \\otimes X + Y \\otimes Y )}
|
529
|
+
|
530
|
+
Parameters
|
531
|
+
----------
|
532
|
+
first: int
|
533
|
+
target qubit
|
534
|
+
second: int
|
535
|
+
target qubit
|
536
|
+
control
|
537
|
+
int or list of ints
|
538
|
+
power
|
539
|
+
numeric type (fixed exponent) or hashable type (parametrized exponent)
|
540
|
+
|
541
|
+
Returns
|
542
|
+
-------
|
543
|
+
QCircuit
|
544
|
+
|
545
|
+
"""
|
546
|
+
|
547
|
+
generator = paulis.from_string(f"X({first})X({second}) + Y({first})Y({second})")
|
548
|
+
|
549
|
+
p0 = paulis.Projector("|00>") + paulis.Projector("|11>")
|
550
|
+
p0 = p0.map_qubits({0:first, 1:second})
|
551
|
+
|
552
|
+
gate = QubitExcitationImpl(angle=power*(-np.pi/2), target=generator.qubits, generator=generator, p0=p0, control=control, compile_options="vanilla", *args, **kwargs)
|
553
|
+
|
554
|
+
return QCircuit.wrap_gate(gate)
|
555
|
+
|
556
|
+
|
557
|
+
def Givens(first: int, second: int, control: typing.Union[int, list] = None, angle: float = None, *args,
|
558
|
+
**kwargs) -> QCircuit:
|
559
|
+
"""
|
560
|
+
Notes
|
561
|
+
----------
|
562
|
+
Givens gate G
|
563
|
+
.. math::
|
564
|
+
G = e^{-i\\theta \\frac{(Y \\otimes X - X \\otimes Y )}{2}}
|
565
|
+
|
566
|
+
Parameters
|
567
|
+
----------
|
568
|
+
first: int
|
569
|
+
target qubit
|
570
|
+
second: int
|
571
|
+
target qubit
|
572
|
+
control
|
573
|
+
int or list of ints
|
574
|
+
angle
|
575
|
+
numeric type (fixed exponent) or hashable type (parametrized exponent), theta in the above formula
|
576
|
+
|
577
|
+
Returns
|
578
|
+
-------
|
579
|
+
QCircuit
|
580
|
+
|
581
|
+
"""
|
582
|
+
|
583
|
+
return QubitExcitation(target=[second,first], angle=2*angle, control=control, *args, **kwargs) # twice the angle since theta is not divided by two in the matrix exponential
|
507
584
|
|
508
585
|
|
509
586
|
"""
|
@@ -965,11 +1042,7 @@ and should all implement a compile function that
|
|
965
1042
|
returns a QCircuit of primitive tq gates
|
966
1043
|
"""
|
967
1044
|
|
968
|
-
class QubitExcitationImpl(impl.
|
969
|
-
|
970
|
-
@property
|
971
|
-
def steps(self):
|
972
|
-
return 1
|
1045
|
+
class QubitExcitationImpl(impl.GeneralizedRotationImpl):
|
973
1046
|
|
974
1047
|
def __init__(self, angle, target, generator=None, p0=None, assume_real=True, control=None, compile_options=None):
|
975
1048
|
angle = assign_variable(angle)
|
@@ -990,15 +1063,9 @@ class QubitExcitationImpl(impl.DifferentiableGateImpl):
|
|
990
1063
|
else:
|
991
1064
|
assert generator is not None
|
992
1065
|
assert p0 is not None
|
993
|
-
|
994
|
-
super().__init__(name="QubitExcitation",
|
995
|
-
|
996
|
-
if control is not None:
|
997
|
-
# augment p0 for control qubits
|
998
|
-
# Qp = 1/2(1+Z) = |0><0|
|
999
|
-
p0 = p0*paulis.Qp(control)
|
1000
|
-
self.p0 = p0
|
1001
|
-
self.assume_real = assume_real
|
1066
|
+
|
1067
|
+
super().__init__(name="QubitExcitation", angle=angle, generator=generator, target=target, p0=p0, control=control, assume_real=assume_real, steps=1)
|
1068
|
+
|
1002
1069
|
if compile_options is None:
|
1003
1070
|
self.compile_options = "optimize"
|
1004
1071
|
elif hasattr(compile_options, "lower"):
|
@@ -1007,26 +1074,21 @@ class QubitExcitationImpl(impl.DifferentiableGateImpl):
|
|
1007
1074
|
self.compile_options = compile_options
|
1008
1075
|
|
1009
1076
|
def map_qubits(self, qubit_map: dict):
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
if mapped_control is not None:
|
1014
|
-
mapped_control=tuple([qubit_map[i] for i in self.control])
|
1015
|
-
result = copy.deepcopy(self)
|
1016
|
-
result.generator=mapped_generator
|
1017
|
-
result.p0 = mapped_p0
|
1018
|
-
result._target = tuple([qubit_map[x] for x in self.target])
|
1019
|
-
result._control = mapped_control
|
1020
|
-
result.finalize()
|
1021
|
-
return result
|
1077
|
+
mapped = super().map_qubits(qubit_map)
|
1078
|
+
mapped.p0 = self.p0.map_qubits(qubit_map=qubit_map)
|
1079
|
+
return mapped
|
1022
1080
|
|
1023
1081
|
def compile(self, exponential_pauli=False, *args, **kwargs):
|
1024
1082
|
# optimized compiling for single and double qubit excitaitons following arxiv:2005.14475
|
1025
1083
|
# Alternative representation in arxiv:2104.05695 (not implemented -> could be added and controlled with optional compile keywords)
|
1084
|
+
if self.is_controlled():
|
1085
|
+
control = list(self.control)
|
1086
|
+
else:
|
1087
|
+
control = []
|
1026
1088
|
if self.compile_options == "optimize" and len(self.target) == 2 and exponential_pauli:
|
1027
1089
|
p,q = self.target
|
1028
1090
|
U0 = X(target=p, control=q)
|
1029
|
-
U1 = Ry(angle=self.parameter, target=q, control=p)
|
1091
|
+
U1 = Ry(angle=self.parameter, target=q, control=[p]+control)
|
1030
1092
|
return U0 + U1 + U0
|
1031
1093
|
elif self.compile_options == "optimize" and len(self.target) == 4 and exponential_pauli:
|
1032
1094
|
p,r,q,s = self.target
|
@@ -1035,39 +1097,11 @@ class QubitExcitationImpl(impl.DifferentiableGateImpl):
|
|
1035
1097
|
U0 += X(target=r, control=p)
|
1036
1098
|
U0 += X(target=q)
|
1037
1099
|
U0 += X(target=s)
|
1038
|
-
U1 = Ry(angle=-self.parameter, target=p, control=[q,r,s])
|
1100
|
+
U1 = Ry(angle=-self.parameter, target=p, control=[q,r,s]+control)
|
1039
1101
|
return U0 + U1 + U0.dagger()
|
1040
1102
|
else:
|
1041
|
-
return Trotterized(angle=self.parameter, generator=self.generator, steps=1)
|
1042
|
-
|
1043
|
-
def shifted_gates(self):
|
1044
|
-
if not self.assume_real:
|
1045
|
-
# following https://arxiv.org/abs/2104.05695
|
1046
|
-
s = 0.5 * np.pi
|
1047
|
-
shifts = [s, -s, 3 * s, -3 * s]
|
1048
|
-
coeff1 = 0.25 * (np.sqrt(2) + 1)/np.sqrt(2)
|
1049
|
-
coeff2 = 0.25 * (np.sqrt(2) - 1)/np.sqrt(2)
|
1050
|
-
coefficients = [coeff1, -coeff1, -coeff2, coeff2]
|
1051
|
-
circuits = []
|
1052
|
-
for i, shift in enumerate(shifts):
|
1053
|
-
shifted_gate = copy.deepcopy(self)
|
1054
|
-
shifted_gate.parameter += shift
|
1055
|
-
circuits.append((coefficients[i], shifted_gate))
|
1056
|
-
return circuits
|
1057
|
-
|
1058
|
-
r = 0.25
|
1059
|
-
s = 0.5*np.pi
|
1060
|
-
|
1061
|
-
Up1 = copy.deepcopy(self)
|
1062
|
-
Up1._parameter = self.parameter+s
|
1063
|
-
Up1 = QCircuit.wrap_gate(Up1)
|
1064
|
-
Up2 = GeneralizedRotation(angle=s, generator=self.p0, eigenvalues_magnitude=r) # controls are in p0
|
1065
|
-
Um1 = copy.deepcopy(self)
|
1066
|
-
Um1._parameter = self.parameter-s
|
1067
|
-
Um1 = QCircuit.wrap_gate(Um1)
|
1068
|
-
Um2 = GeneralizedRotation(angle=-s, generator=self.p0, eigenvalues_magnitude=r) # controls are in p0
|
1069
|
-
|
1070
|
-
return [(2.0 * r, Up1 + Up2), (-2.0 * r, Um1 + Um2)]
|
1103
|
+
return Trotterized(angle=self.parameter, generator=self.generator, steps=1, control=self.control)
|
1104
|
+
|
1071
1105
|
|
1072
1106
|
def _convert_Paulistring(paulistring: typing.Union[PauliString, str, dict]) -> PauliString:
|
1073
1107
|
'''
|
@@ -871,22 +871,69 @@ def compute_meas_alloc(varbs, obt=None, tbts=None, n_qubits=None, mix=0.0):
|
|
871
871
|
for i in range(len(meas_alloc)):
|
872
872
|
if meas_alloc[i] < 1e-6:
|
873
873
|
meas_alloc[i] = 1e-6
|
874
|
-
return np.real( meas_alloc/np.sum(meas_alloc)
|
874
|
+
return np.real( meas_alloc/np.sum(meas_alloc))
|
875
875
|
|
876
|
-
def
|
876
|
+
def depth_eff_order_mf(N):
|
877
|
+
'''
|
878
|
+
Returns index ordering for linear depth circuit
|
879
|
+
|
880
|
+
For example N = 6 gives elimination order
|
881
|
+
[ 0. 0. 0. 0. 0. 0.]
|
882
|
+
[ 7. 0. 0. 0. 0. 0.]
|
883
|
+
[ 5. 10. 0. 0. 0. 0.]
|
884
|
+
[ 3. 8. 12. 0. 0. 0.]
|
885
|
+
[ 2. 6. 11. 14. 0. 0.]
|
886
|
+
[ 1. 4. 9. 13. 15. 0.]
|
887
|
+
'''
|
888
|
+
l = []
|
889
|
+
for c in range(0, N-1):
|
890
|
+
for r in range(1, N):
|
891
|
+
if r - c > 0:
|
892
|
+
l.append([r, c, 2*c - r + N])
|
893
|
+
l.sort(key=lambda x: x[2])
|
894
|
+
return [(a[0], a[1]) for a in l]
|
895
|
+
|
896
|
+
def get_orb_rot(U, qubit_list = [], method = 'short', tol = 1e-12):
|
877
897
|
'''
|
878
898
|
Construct sequence of orbital rotations that implement mean-field unitary given by NxN unitary U
|
879
899
|
Currently supported only for real U
|
880
900
|
'''
|
881
|
-
|
882
|
-
|
901
|
+
|
902
|
+
N = len(U)
|
883
903
|
C = tq.QCircuit()
|
884
|
-
|
885
|
-
|
904
|
+
|
905
|
+
if qubit_list == []:
|
906
|
+
qubit_list = list(range(N))
|
907
|
+
|
908
|
+
assert len(qubit_list) >= len(U), 'Insufficient qubits for orbital rotation' #check if sufficient qubits
|
909
|
+
|
910
|
+
U[abs(U) < tol] = 0
|
911
|
+
|
912
|
+
if method == 'naive':
|
913
|
+
theta_list, phi_list = given_rotation(U, tol)
|
914
|
+
elif method == 'short':
|
915
|
+
ordering = depth_eff_order_mf(N)
|
916
|
+
theta_list, phi_list = given_rotation(U, tol, ordering)
|
917
|
+
|
918
|
+
#filter
|
919
|
+
theta_list_new = []
|
920
|
+
for i, theta in enumerate(theta_list):
|
921
|
+
if abs(theta[0] % (2*np.pi)) > tol:
|
922
|
+
theta_list_new.append(theta)
|
923
|
+
|
924
|
+
phi_list_new = []
|
925
|
+
for i, phi in enumerate(phi_list):
|
926
|
+
if abs(phi[0]) > tol:
|
927
|
+
phi_list_new.append(phi)
|
928
|
+
|
929
|
+
for phi in phi_list_new:
|
930
|
+
C += n_rotation(qubit_list[phi[1]], phi[0])
|
931
|
+
|
886
932
|
gates = []
|
887
|
-
for
|
888
|
-
gates.append(orbital_rotation(
|
933
|
+
for theta in theta_list_new:
|
934
|
+
gates.append(orbital_rotation(qubit_list[theta[1]], qubit_list[theta[2]], -theta[0]))
|
889
935
|
gates.reverse()
|
936
|
+
|
890
937
|
for gate in gates:
|
891
938
|
C += gate
|
892
939
|
return C
|
@@ -894,7 +941,7 @@ def get_orb_rot(U, tol = 1e-12):
|
|
894
941
|
def orbital_rotation(i, j, theta):
|
895
942
|
'''
|
896
943
|
Implements exp(theta(a^_i a_j - a^_j a_i))
|
897
|
-
Right now restricted to |i-j| <= 1
|
944
|
+
Right now restricted to |i-j| <= 1 and jordan wigner transform.
|
898
945
|
'''
|
899
946
|
if abs(i-j) <= 1:
|
900
947
|
return tq.gates.CNOT(control=i, target=j) + tq.gates.Ry(angle=2*theta, target=i, control=j) + tq.gates.CNOT(control=i, target=j)
|
@@ -902,25 +949,39 @@ def orbital_rotation(i, j, theta):
|
|
902
949
|
def n_rotation(i, phi):
|
903
950
|
return tq.gates.Rz(angle = phi, target=i)
|
904
951
|
|
905
|
-
def given_rotation(U, tol = 1e-12):
|
952
|
+
def given_rotation(U, tol = 1e-12, ordering = None):
|
906
953
|
'''
|
907
954
|
Decomposes the Unitary into a set of Rz by angle phi and Givens Rotations by angle theta.
|
908
955
|
Input:
|
909
|
-
U (np.array):
|
956
|
+
U (np.array): Rotation matrix
|
957
|
+
tol: tolerance for U elements
|
910
958
|
'''
|
911
|
-
|
959
|
+
|
912
960
|
U[abs(U) < tol] = 0
|
913
961
|
n = U.shape[0]
|
962
|
+
|
914
963
|
theta = []
|
915
964
|
phi = []
|
916
|
-
|
917
|
-
for
|
965
|
+
if ordering is None:
|
966
|
+
for c in range(n):
|
967
|
+
for r in range(n-1, c, -1):
|
968
|
+
t = np.arctan2(-U[r,c], U[r-1,c])
|
969
|
+
theta.append((t, r, r-1))
|
970
|
+
|
971
|
+
g = givens_matrix(n,r,r-1,t)
|
972
|
+
U = np.dot(g, U)
|
973
|
+
else:
|
974
|
+
for r, c in ordering:
|
918
975
|
t = np.arctan2(-U[r,c], U[r-1,c])
|
919
|
-
theta.append(
|
976
|
+
theta.append((t, r, r-1))
|
977
|
+
|
920
978
|
g = givens_matrix(n,r,r-1,t)
|
921
979
|
U = np.dot(g, U)
|
980
|
+
|
922
981
|
for i in range(n):
|
923
|
-
|
982
|
+
ph = np.angle(U[i,i])
|
983
|
+
phi.append((ph, i))
|
984
|
+
|
924
985
|
return theta, phi
|
925
986
|
|
926
987
|
def givens_matrix(n, p, q, theta): #verified
|
@@ -214,12 +214,15 @@ def do_svd(h_ferm, n_elec):
|
|
214
214
|
return all_uops, cartan_obt, cartan_tbts, meas_alloc
|
215
215
|
|
216
216
|
|
217
|
-
def get_fermion_wise(H, U):
|
217
|
+
def get_fermion_wise(H, U, qubit_list = []):
|
218
|
+
'''
|
219
|
+
Return z_form and orbital rotations over qubits at qubit_list
|
220
|
+
'''
|
218
221
|
|
219
222
|
H = ferm.cartan_tbt_to_ferm(H, spin_orb = True)
|
220
223
|
z_form = QubitHamiltonian(jordan_wigner(H))
|
221
224
|
|
222
|
-
circuit = ferm.get_orb_rot(U, tol = 1e-12)
|
225
|
+
circuit = ferm.get_orb_rot(U, qubit_list=qubit_list, tol = 1e-12)
|
223
226
|
return [z_form, circuit]
|
224
227
|
|
225
228
|
def get_init_ops(h_ferm, mol_name, calc_type, spin_orb, save=True):
|
tequila/hamiltonian/paulis.py
CHANGED
@@ -334,11 +334,12 @@ class OptimizerGD(Optimizer):
|
|
334
334
|
|
335
335
|
|
336
336
|
if not self.silent:
|
337
|
+
self.__dx = numpy.asarray(self.__dx)
|
337
338
|
print("%3i %+15.8f %+7.2e %7.3e %7.3e %s"
|
338
339
|
% (step,
|
339
340
|
e,
|
340
341
|
e-last,
|
341
|
-
numpy.max(abs(self.__dx)
|
342
|
+
numpy.max([abs(x) for x in self.__dx]),
|
342
343
|
numpy.sqrt(numpy.average(self.__dx**2)),
|
343
344
|
comment))
|
344
345
|
|
@@ -37,7 +37,7 @@ class OptimizeOrbitalsResult:
|
|
37
37
|
self.iterations += 1
|
38
38
|
|
39
39
|
def optimize_orbitals(molecule, circuit=None, vqe_solver=None, pyscf_arguments=None, silent=False,
|
40
|
-
vqe_solver_arguments=None, initial_guess=None, return_mcscf=False, use_hcb=False, *args, **kwargs):
|
40
|
+
vqe_solver_arguments=None, initial_guess=None, return_mcscf=False, use_hcb=False, molecule_factory=None, *args, **kwargs):
|
41
41
|
"""
|
42
42
|
|
43
43
|
Parameters
|
@@ -97,9 +97,9 @@ def optimize_orbitals(molecule, circuit=None, vqe_solver=None, pyscf_arguments=N
|
|
97
97
|
if n_qubits > n_orbitals:
|
98
98
|
warnings.warn("Potential inconsistency in orbital optimization: use_hcb is switched on but we have\n n_qubits={} in the circuit\n n_orbital={} in the molecule\n".format(n_qubits,n_orbitals), TequilaWarning)
|
99
99
|
|
100
|
-
wrapper = PySCFVQEWrapper(molecule_arguments=pyscf_molecule.parameters, n_electrons=pyscf_molecule.n_electrons,
|
100
|
+
wrapper = PySCFVQEWrapper(molecule_arguments={"parameters":pyscf_molecule.parameters, "transformation":molecule.transformation}, n_electrons=pyscf_molecule.n_electrons,
|
101
101
|
const_part=c, circuit=circuit, vqe_solver_arguments=vqe_solver_arguments, silent=silent,
|
102
|
-
vqe_solver=vqe_solver, *args, **kwargs)
|
102
|
+
vqe_solver=vqe_solver, molecule_factory=molecule_factory, *args, **kwargs)
|
103
103
|
mc.fcisolver = wrapper
|
104
104
|
mc.internal_rotation = True
|
105
105
|
if pyscf_arguments is not None:
|
@@ -153,7 +153,7 @@ class PySCFVQEWrapper:
|
|
153
153
|
|
154
154
|
# needs initialization
|
155
155
|
n_electrons: int = None
|
156
|
-
molecule_arguments:
|
156
|
+
molecule_arguments: dict = None
|
157
157
|
|
158
158
|
# internal data
|
159
159
|
rdm1: numpy.ndarray = None
|
@@ -168,6 +168,7 @@ class PySCFVQEWrapper:
|
|
168
168
|
vqe_solver: typing.Callable = None
|
169
169
|
circuit: QCircuit = None
|
170
170
|
vqe_solver_arguments: dict = field(default_factory=dict)
|
171
|
+
molecule_factory: typing.Callable = None
|
171
172
|
|
172
173
|
def reorder(self, M, ordering, to):
|
173
174
|
# convenience since we need to reorder
|
@@ -183,9 +184,14 @@ class PySCFVQEWrapper:
|
|
183
184
|
restrict_to_hcb = self.vqe_solver_arguments is not None and "restrict_to_hcb" in self.vqe_solver_arguments and \
|
184
185
|
self.vqe_solver_arguments["restrict_to_hcb"]
|
185
186
|
|
186
|
-
|
187
|
+
if self.molecule_factory is None:
|
188
|
+
molecule = QuantumChemistryBase(one_body_integrals=h1, two_body_integrals=h2of,
|
187
189
|
nuclear_repulsion=self.const_part, n_electrons=self.n_electrons,
|
188
|
-
|
190
|
+
**self.molecule_arguments)
|
191
|
+
else:
|
192
|
+
molecule = self.molecule_factory(one_body_integrals=h1, two_body_integrals=h2of,
|
193
|
+
nuclear_repulsion=self.const_part, n_electrons=self.n_electrons,
|
194
|
+
**self.molecule_arguments)
|
189
195
|
if restrict_to_hcb:
|
190
196
|
H = molecule.make_hardcore_boson_hamiltonian()
|
191
197
|
else:
|
@@ -214,7 +220,7 @@ class PySCFVQEWrapper:
|
|
214
220
|
else:
|
215
221
|
# static ansatz
|
216
222
|
U = self.circuit
|
217
|
-
|
223
|
+
|
218
224
|
rdm1, rdm2 = molecule.compute_rdms(U=U, variables=result.variables, spin_free=True, get_rdm1=True, get_rdm2=True, use_hcb=restrict_to_hcb)
|
219
225
|
rdm2 = self.reorder(rdm2, 'dirac', 'mulliken')
|
220
226
|
if not self.silent:
|
@@ -1,11 +1,9 @@
|
|
1
|
-
from tequila import TequilaException
|
2
|
-
from openfermion import MolecularData
|
1
|
+
from tequila import TequilaException
|
3
2
|
from tequila.quantumchemistry.qc_base import QuantumChemistryBase
|
4
3
|
from tequila.quantumchemistry import ParametersQC, NBodyTensor
|
5
|
-
from dataclasses import dataclass, field
|
6
4
|
import pyscf
|
7
5
|
|
8
|
-
import numpy, typing
|
6
|
+
import numpy, typing
|
9
7
|
|
10
8
|
|
11
9
|
class OpenVQEEPySCFException(TequilaException):
|
@@ -48,7 +46,15 @@ class QuantumChemistryPySCF(QuantumChemistryBase):
|
|
48
46
|
# solve restricted HF
|
49
47
|
mf = pyscf.scf.RHF(mol)
|
50
48
|
mf.kernel()
|
51
|
-
|
49
|
+
|
50
|
+
# only works if point_group is not C1
|
51
|
+
# otherwise PySCF uses a different SCF object
|
52
|
+
# irrep information is however not critical to tequila
|
53
|
+
if hasattr(mf, "get_irrep_nelec"):
|
54
|
+
self.irreps = mf.get_irrep_nelec()
|
55
|
+
else:
|
56
|
+
self.irreps = None
|
57
|
+
|
52
58
|
orbital_energies = mf.mo_energy
|
53
59
|
|
54
60
|
# compute mo integrals
|
@@ -71,18 +77,6 @@ class QuantumChemistryPySCF(QuantumChemistryBase):
|
|
71
77
|
|
72
78
|
super().__init__(parameters=parameters, transformation=transformation, *args, **kwargs)
|
73
79
|
|
74
|
-
@classmethod
|
75
|
-
def from_tequila(cls, molecule, transformation=None, *args, **kwargs):
|
76
|
-
c, h1, h2 = molecule.get_integrals()
|
77
|
-
if transformation is None:
|
78
|
-
transformation = molecule.transformation
|
79
|
-
return cls(nuclear_repulsion=c,
|
80
|
-
one_body_integrals=h1,
|
81
|
-
two_body_integrals=h2,
|
82
|
-
n_electrons=molecule.n_electrons,
|
83
|
-
transformation=transformation,
|
84
|
-
parameters=molecule.parameters, *args, **kwargs)
|
85
|
-
|
86
80
|
def compute_fci(self, *args, **kwargs):
|
87
81
|
from pyscf import fci
|
88
82
|
c, h1, h2 = self.get_integrals(ordering="chem")
|
@@ -106,6 +106,19 @@ class QuantumChemistryBase:
|
|
106
106
|
self._rdm1 = None
|
107
107
|
self._rdm2 = None
|
108
108
|
|
109
|
+
|
110
|
+
@classmethod
|
111
|
+
def from_tequila(cls, molecule, transformation=None, *args, **kwargs):
|
112
|
+
c, h1, h2 = molecule.get_integrals()
|
113
|
+
if transformation is None:
|
114
|
+
transformation = molecule.transformation
|
115
|
+
return cls(nuclear_repulsion=c,
|
116
|
+
one_body_integrals=h1,
|
117
|
+
two_body_integrals=h2,
|
118
|
+
n_electrons=molecule.n_electrons,
|
119
|
+
transformation=transformation,
|
120
|
+
parameters=molecule.parameters, *args, **kwargs)
|
121
|
+
|
109
122
|
def supports_ucc(self):
|
110
123
|
"""
|
111
124
|
check if the current molecule supports UCC operations
|
@@ -1089,7 +1102,8 @@ class QuantumChemistryBase:
|
|
1089
1102
|
assume_real: bool = True,
|
1090
1103
|
hcb_optimization: bool = None,
|
1091
1104
|
spin_adapt_singles: bool = True,
|
1092
|
-
neglect_z=False,
|
1105
|
+
neglect_z: bool = False,
|
1106
|
+
mix_sd: bool = False,
|
1093
1107
|
*args, **kwargs):
|
1094
1108
|
"""
|
1095
1109
|
UpGCCSD Ansatz similar as described by Lee et. al.
|
@@ -1114,6 +1128,10 @@ class QuantumChemistryBase:
|
|
1114
1128
|
assume_real
|
1115
1129
|
assume a real wavefunction (that is always the case if the reference state is real)
|
1116
1130
|
reduces potential gradient costs from 4 to 2
|
1131
|
+
mix_sd
|
1132
|
+
Changes the ordering from first all doubles and then all singles excitations (DDDDD....SSSS....) to
|
1133
|
+
a mixed order (DS-DS-DS-DS-...) where one DS pair acts on the same MOs. Useful to consider when systems
|
1134
|
+
with high electronic correlation and system high error associated with the no Trotterized UCC.
|
1117
1135
|
Returns
|
1118
1136
|
-------
|
1119
1137
|
UpGCCSD ansatz
|
@@ -1154,7 +1172,8 @@ class QuantumChemistryBase:
|
|
1154
1172
|
raise Exception(
|
1155
1173
|
"name={}, Singles can't be realized without mapping back to the standard encoding leave S or HCB out of the name".format(
|
1156
1174
|
name))
|
1157
|
-
|
1175
|
+
if hcb_optimization and mix_sd:
|
1176
|
+
raise TequilaException("Mixed SD can not be employed together with HCB Optimization")
|
1158
1177
|
# convenience
|
1159
1178
|
S = "S" in name.upper()
|
1160
1179
|
D = "D" in name.upper()
|
@@ -1165,7 +1184,8 @@ class QuantumChemistryBase:
|
|
1165
1184
|
if include_reference:
|
1166
1185
|
U = self.prepare_reference()
|
1167
1186
|
U += self.make_upccgsd_layer(include_singles=S, include_doubles=D, indices=indices, assume_real=assume_real,
|
1168
|
-
label=(label, 0), spin_adapt_singles=spin_adapt_singles, *args,
|
1187
|
+
label=(label, 0), mix_sd=mix_sd, spin_adapt_singles=spin_adapt_singles, *args,
|
1188
|
+
**kwargs)
|
1169
1189
|
else:
|
1170
1190
|
U = QCircuit()
|
1171
1191
|
if include_reference:
|
@@ -1184,12 +1204,14 @@ class QuantumChemistryBase:
|
|
1184
1204
|
|
1185
1205
|
for k in range(1, order):
|
1186
1206
|
U += self.make_upccgsd_layer(include_singles=S, include_doubles=D, indices=indices, label=(label, k),
|
1187
|
-
spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z)
|
1207
|
+
spin_adapt_singles=spin_adapt_singles, neglect_z=neglect_z, mix_sd=mix_sd)
|
1188
1208
|
|
1189
1209
|
return U
|
1190
1210
|
|
1191
|
-
def make_upccgsd_layer(self, indices, include_singles=True, include_doubles=
|
1192
|
-
|
1211
|
+
def make_upccgsd_layer(self, indices, include_singles: bool = True, include_doubles: bool = True,
|
1212
|
+
assume_real: bool = True, label=None,
|
1213
|
+
spin_adapt_singles: bool = True, angle_transform=None, mix_sd: bool = False,
|
1214
|
+
neglect_z: bool = False, *args,
|
1193
1215
|
**kwargs):
|
1194
1216
|
U = QCircuit()
|
1195
1217
|
for idx in indices:
|
@@ -1207,7 +1229,7 @@ class QuantumChemistryBase:
|
|
1207
1229
|
indices=((2 * idx[0], 2 * idx[1]), (2 * idx[0] + 1, 2 * idx[1] + 1)),
|
1208
1230
|
assume_real=assume_real, **kwargs)
|
1209
1231
|
if include_singles and mix_sd:
|
1210
|
-
U += self.make_upccgsd_singles(indices=[idx], assume_real=assume_real, label=label,
|
1232
|
+
U += self.make_upccgsd_singles(indices=[(idx,)], assume_real=assume_real, label=label,
|
1211
1233
|
spin_adapt_singles=spin_adapt_singles, angle_transform=angle_transform,
|
1212
1234
|
neglect_z=neglect_z)
|
1213
1235
|
|
@@ -5,10 +5,12 @@ from tequila import BitString, BitNumbering
|
|
5
5
|
import sympy
|
6
6
|
from tequila.utils import to_float
|
7
7
|
|
8
|
+
import importlib
|
8
9
|
import numpy as np
|
9
10
|
import typing, numbers
|
10
11
|
|
11
12
|
import cirq
|
13
|
+
import cirq_google
|
12
14
|
|
13
15
|
map_1 = lambda x: {'exponent': x}
|
14
16
|
map_2 = lambda x: {'exponent': x / np.pi, 'global_shift': -0.5}
|
@@ -356,35 +358,23 @@ class BackendCircuitCirq(BackendCircuit):
|
|
356
358
|
line = None
|
357
359
|
circuit = None
|
358
360
|
if isinstance(device, cirq.Device):
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
circuit = cirq.google.optimized_for_sycamore(circuit=c, new_device=device,
|
369
|
-
optimizer_type=option,
|
370
|
-
qubit_map=lambda q: line[q.x])
|
371
|
-
except:
|
372
|
-
line = None
|
373
|
-
pass
|
374
|
-
if circuit is None:
|
375
|
-
raise TequilaCirqException('could not optimize for device={}'.format(device))
|
376
|
-
|
361
|
+
HAS_GOOGLE = importlib.util.find_spec('cirq_google')
|
362
|
+
assert HAS_GOOGLE, TequilaCirqException(' cirq_google package is not installed.')
|
363
|
+
|
364
|
+
if device in [cirq_google.Sycamore, cirq_google.Sycamore23]:
|
365
|
+
try:
|
366
|
+
circuit = cirq.optimize_for_target_gateset(circuit=c, gateset=cirq_google.SycamoreTargetGateset())
|
367
|
+
except ValueError as E:
|
368
|
+
original_message = str(E)
|
369
|
+
raise TequilaCirqException('original message:\n{}\n\ncould not optimize for device={}'.format(original_message,device))
|
377
370
|
else:
|
378
371
|
### under construction (potentially on other branches)
|
379
|
-
raise TequilaException('Only
|
372
|
+
raise TequilaException('Only Sycamore and Sycamore23 devices currently functional. Sorry!')
|
373
|
+
|
380
374
|
else:
|
381
375
|
raise TequilaException(
|
382
376
|
'build_device_circuit demands a cirq.Device object; received {}, of type {}'.format(str(device),
|
383
377
|
type(device)))
|
384
|
-
|
385
|
-
if line is not None:
|
386
|
-
for k in self.qubit_map.keys():
|
387
|
-
self.qubit_map[k].instance = line[self.qubit_map[k].instance.x]
|
388
378
|
return circuit
|
389
379
|
|
390
380
|
def build_noisy_circuit(self, noise):
|
@@ -447,7 +437,7 @@ class BackendCircuitCirq(BackendCircuit):
|
|
447
437
|
the device on which to execute cirq circuits.
|
448
438
|
"""
|
449
439
|
if isinstance(device, str):
|
450
|
-
return getattr(
|
440
|
+
return getattr(cirq_google, device)
|
451
441
|
else:
|
452
442
|
if device is None:
|
453
443
|
return device
|
@@ -474,7 +464,7 @@ class BackendCircuitCirq(BackendCircuit):
|
|
474
464
|
return
|
475
465
|
else:
|
476
466
|
assert isinstance(device, str)
|
477
|
-
if device.lower() in ['
|
467
|
+
if device.lower() in ['sycamore', 'sycamore23']:
|
478
468
|
pass
|
479
469
|
else:
|
480
470
|
raise TequilaException('requested device {} could not be found!'.format(device))
|
tequila/version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
__version__ = "1.
|
2
|
-
__author__ = "
|
1
|
+
__version__ = "1.9.1"
|
2
|
+
__author__ = "Tequila Developers "
|
@@ -1,19 +1,19 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tequila-basic
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.9.1
|
4
4
|
Summary: A High-Level Abstraction Framework for Quantum Algorithms
|
5
5
|
Home-page: https://github.com/tequilahub/tequila
|
6
|
-
Author:
|
6
|
+
Author: Tequila Developers
|
7
7
|
Author-email: jakob.kottmann@gmail.com
|
8
8
|
Description-Content-Type: text/markdown
|
9
9
|
License-File: LICENSE
|
10
10
|
Requires-Dist: numpy
|
11
|
-
Requires-Dist: scipy
|
11
|
+
Requires-Dist: scipy <1.11
|
12
12
|
Requires-Dist: sympy
|
13
13
|
Requires-Dist: autograd
|
14
14
|
Requires-Dist: setuptools
|
15
15
|
Requires-Dist: pytest
|
16
|
-
Requires-Dist: openfermion
|
16
|
+
Requires-Dist: openfermion ~=1.0
|
17
17
|
Requires-Dist: dataclasses ; python_version < "3.7"
|
18
18
|
|
19
19
|
[](LICENCE) [](https://zenodo.org/badge/latestdoi/259718912) [](https://badge.fury.io/py/tequila-basic) 
|
@@ -33,7 +33,7 @@ Tequila can execute the underlying quantum expectation values on state of the ar
|
|
33
33
|
|
34
34
|
# Installation
|
35
35
|
Recommended Python version is 3.8-3.9.
|
36
|
-
Tequila supports linux, osx and windows. However, not all optional dependencies are supported on windows.
|
36
|
+
Tequila supports linux, osx and windows. However, not all optional dependencies are supported on windows.
|
37
37
|
|
38
38
|
## Install from PyPi
|
39
39
|
**Do not** install like this: (Minecraft lovers excluded)
|
@@ -246,6 +246,17 @@ K. Gratsea, C. Sun, P.D. Johnson
|
|
246
246
|
When to Reject a Ground State Preparation Algorithm
|
247
247
|
[arxiv:2212.09492](https://doi.org/10.48550/arXiv.2212.09492)
|
248
248
|
|
249
|
+
R.P. Pothukuchi, L. Lufkin, Y.J. Shen, A. Simon, R. Thorstenson, B.E. Trevisan, M. Tu, M. Yang, B. Foxman, V. S. Pothukuchi, G. Epping, B. J. Jongkees, T.-H. Kyaw, J. R. Busemeyer, J. D Cohen, A. Bhattacharjee
|
250
|
+
Quantum Cognitive Modeling: New Applications and Systems Research Directions
|
251
|
+
[arxiv:2309.00597](https://arxiv.org/abs/2309.00597)
|
252
|
+
|
253
|
+
T.-H. Kyaw, M. B. Soley, B. Allen, P. Bergold, C. Sun, V.S. Batista and A. Aspuru-Guzik
|
254
|
+
Boosting quantum amplitude exponentially in variational quantum algorithms
|
255
|
+
[10.1088/2058-9565/acf4ba](doi.org/10.1088/2058-9565/acf4ba)
|
256
|
+
|
257
|
+
A.G. Cadavid, I. Montalban, A. Dalal, E. Solano, N.N. Hegade
|
258
|
+
Efficient DCQO Algorithm within the Impulse Regime for Portfolio Optimization
|
259
|
+
[arxiv:2308.15475](https://arxiv.org/abs/2308.15475)
|
249
260
|
|
250
261
|
Let us know, if you want your research project and/or tutorial to be included in this list!
|
251
262
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
tequila/__init__.py,sha256=FV8-j7GEw_VYadsZUp3M2mGRQxVUYYG3W1jiI6in3CY,1959
|
2
2
|
tequila/autograd_imports.py,sha256=t7V5uYaI0GzjD7pSjkYtiaj3BzSvkm_RL2KcYfNwNhM,1529
|
3
|
-
tequila/version.py,sha256=
|
3
|
+
tequila/version.py,sha256=OQns-ZLbw14JA1biX794LPwT3m5kGViyNFrR4FKkTfU,57
|
4
4
|
tequila/apps/__init__.py,sha256=GJb04napv8AAx5EHxS5C1CMv9kxQeu7aA-ZMWk6X_eQ,1623
|
5
5
|
tequila/apps/_unary_state_prep_impl.py,sha256=SzRtI0Nx29ODygvYYdC1NnSTCL70wY7NTAvqhiwpMDs,21757
|
6
6
|
tequila/apps/unary_state_prep.py,sha256=QCrD9Ty2RkXc1Mh_MitFPIdaPs_fLxp_dtWVBZi0tSE,9403
|
@@ -12,10 +12,10 @@ tequila/apps/robustness/__init__.py,sha256=6BOjqcFWP3ymuit4JJ5cbzxS-G2AOCTdwcl87
|
|
12
12
|
tequila/apps/robustness/helpers.py,sha256=t8VgwMfgrhVaa0sNYaxfCIHsEQXL4WAEaT-UJGJkFyE,2721
|
13
13
|
tequila/apps/robustness/interval.py,sha256=m3D1wBRTLRpGQdnabzcDrlxWqN0uCf80NG-enbZrcoY,24735
|
14
14
|
tequila/circuit/__init__.py,sha256=ZgoUEjU_NggxjKYkJjh5aO-6VdUjnO5CLxKB44rHzQc,301
|
15
|
-
tequila/circuit/_gates_impl.py,sha256
|
15
|
+
tequila/circuit/_gates_impl.py,sha256=iB40Sg9l9UoCCayu0l4vGjgvEHUVVbXMaGdUtXIHa1w,17821
|
16
16
|
tequila/circuit/circuit.py,sha256=u1qwDFNrZspgea4BFcxwG-hk43ZKAtO2GVCchuctu4s,32044
|
17
17
|
tequila/circuit/compiler.py,sha256=fsHnnNZo43VWUl_n34P21b4GAi7k2kwoYdx0xlbAuZY,32685
|
18
|
-
tequila/circuit/gates.py,sha256=
|
18
|
+
tequila/circuit/gates.py,sha256=pOvX9_vACFyUAZRG4EGW3_aZGXysUJwUV8oFiKyLJ50,35906
|
19
19
|
tequila/circuit/gradient.py,sha256=Y4dNL6nkZUEkKJvaA3hxaSEa8_b_3XZwxy3j8tGsOmA,10465
|
20
20
|
tequila/circuit/noise.py,sha256=2LJ7Xq5f78x9p4imIz76l_lABQZwgNteNBFkWmUAQvo,8322
|
21
21
|
tequila/circuit/pyzx.py,sha256=XHhKoklhEcbpYkgkWHBLmKF-vyt_Oz-pX-Ctvd4nAOQ,1472
|
@@ -26,11 +26,11 @@ tequila/grouping/binary_rep.py,sha256=VVM2o6B_RC0uH8kqE4yNxTzkGlgUm-CJTZ6z5J7R9I
|
|
26
26
|
tequila/grouping/binary_utils.py,sha256=ubV8zv3nmz2o74A2W69LeCH6bIZZLHw48lk8ROv-jas,10916
|
27
27
|
tequila/grouping/compile_groups.py,sha256=a9it48zZxJs167nz1FWS_oEmPHPuXq0oLaCs1hJgyBE,66415
|
28
28
|
tequila/grouping/ev_utils.py,sha256=4pnzjRYyOB4KTZsfhs7YSU8Ez4jCJP3YSFKtMOjSwgY,8968
|
29
|
-
tequila/grouping/fermionic_functions.py,sha256=
|
30
|
-
tequila/grouping/fermionic_methods.py,sha256
|
29
|
+
tequila/grouping/fermionic_functions.py,sha256=v9R9L43t3CNQlIo-k3uTk2nlP69TyVyyFKSHu0bxiNg,34109
|
30
|
+
tequila/grouping/fermionic_methods.py,sha256=-vzRE5wLw49tTLPP0EUAKq-di6BTT2bc1EwA7tdnBns,27807
|
31
31
|
tequila/grouping/overlapping_methods.py,sha256=A8oVXInkZxqrBh_SoOcUwdAca6dbiF5O4YheQFAaU1s,11059
|
32
32
|
tequila/hamiltonian/__init__.py,sha256=X7edib1ejUf01hb8Jk5IHYnAP51WoN0UAhg4yLRicFI,119
|
33
|
-
tequila/hamiltonian/paulis.py,sha256=
|
33
|
+
tequila/hamiltonian/paulis.py,sha256=a_tOS4PU3_uNHyc4nH4LwvKhC3vQ7Yan7LTiIoGkC-I,9037
|
34
34
|
tequila/hamiltonian/paulistring.py,sha256=zX3G6nljdYeQnhHsOAG0Pwx-7CJVMOc6SPV8d5ZYK1U,351
|
35
35
|
tequila/hamiltonian/qubit_hamiltonian.py,sha256=jPEZ0FxVVHNKou2iS4cZK0ysByOZSbY-VZ6XFLxTakg,21391
|
36
36
|
tequila/ml/__init__.py,sha256=ojCJTssfvNxw2aFnXf7IWaOL8XigFxDZihFPZrVfjcg,120
|
@@ -44,7 +44,7 @@ tequila/objective/qtensor.py,sha256=eSjFOEVW-kLoM8jn1RD2_E_kHVAm579Ji3_lMcJg7cE,
|
|
44
44
|
tequila/optimizers/__init__.py,sha256=sSyXc_FD0wTzS0cmgkdf1DhH-0XMUp2k5wARMM57nhI,5603
|
45
45
|
tequila/optimizers/_containers.py,sha256=CXbWWQory_aADxlaMw4deIr03K_el-0E12GmpA0vX10,7161
|
46
46
|
tequila/optimizers/optimizer_base.py,sha256=Nc1HwlgfeB6XifoaWdFVLhdyHfeqQuhLvOtmtoFDMPY,32272
|
47
|
-
tequila/optimizers/optimizer_gd.py,sha256=
|
47
|
+
tequila/optimizers/optimizer_gd.py,sha256=QF84K2XDn_-0w9htDlEpIaaGGtfudNamIvVCgx1JkuE,39059
|
48
48
|
tequila/optimizers/optimizer_gpyopt.py,sha256=ZDiln0khwc5PHTBuX83eRkclSKIt-iFVYaTK8A1ZX9w,11313
|
49
49
|
tequila/optimizers/optimizer_phoenics.py,sha256=31GBSC4P_-JqjYn3Bjmn3W7vDXW3Zn8aRxi8FWh2Uqc,13448
|
50
50
|
tequila/optimizers/optimizer_scipy.py,sha256=zqRVQ-Whr74KCGP7Zg1jQkl9S3j9s1kS4oCrCtX30gY,18949
|
@@ -52,14 +52,14 @@ tequila/quantumchemistry/__init__.py,sha256=7P3LAgRt9BYHFlByOx0u_lkYuUykqMXPFnic
|
|
52
52
|
tequila/quantumchemistry/chemistry_tools.py,sha256=zQ9CX3qXhkGvSpdsZGHzdwnzCBP-PhY06M0FyOXJedc,40939
|
53
53
|
tequila/quantumchemistry/encodings.py,sha256=y9h6rjq1K9IPVBMbRFQWXyBuAIZzgh2DVw2IUKtpuIM,8656
|
54
54
|
tequila/quantumchemistry/madness_interface.py,sha256=WbBnbVInjoA_2xtp7ejifj2I1L7ZHtxK5ToOEwMD2BY,36254
|
55
|
-
tequila/quantumchemistry/orbital_optimizer.py,sha256=
|
55
|
+
tequila/quantumchemistry/orbital_optimizer.py,sha256=dmwj9cm0wj6W6oSvhO-JTNJVF6EQH5onF4JOkvsncL0,11745
|
56
56
|
tequila/quantumchemistry/psi4_interface.py,sha256=syNaDvlSmCsyB4f7idn3VGbMKyKo83vJHD5y5LpHwaM,29953
|
57
|
-
tequila/quantumchemistry/pyscf_interface.py,sha256=
|
58
|
-
tequila/quantumchemistry/qc_base.py,sha256=
|
57
|
+
tequila/quantumchemistry/pyscf_interface.py,sha256=hOHtT8ONiNAc0MNNnztE2tVq1OHMxobUsniRYuZh9sQ,5995
|
58
|
+
tequila/quantumchemistry/qc_base.py,sha256=oze8z7LyP0gvJcwMZzPjuEfa3neOfbzBF2m7O_ds6WA,92858
|
59
59
|
tequila/simulators/__init__.py,sha256=VFw4sJIt4Zc0-__eYnksN8Ku9qMhbPpHJEkXMWUiD30,4
|
60
60
|
tequila/simulators/simulator_api.py,sha256=mLYA6GzujaNAGrDq1rtLQrW8tFZsCeyYnOnWRTlU6Eo,24172
|
61
61
|
tequila/simulators/simulator_base.py,sha256=93d-f4fNkJ2CtpL9OpgKcypmZH96Mdd9ESdZYn9jH48,33174
|
62
|
-
tequila/simulators/simulator_cirq.py,sha256=
|
62
|
+
tequila/simulators/simulator_cirq.py,sha256=z8G3dtZluaQZWPaNs4o3SBKfC33GClC-nplVOyhI1sg,16535
|
63
63
|
tequila/simulators/simulator_pyquil.py,sha256=Xm8fDg9PTFOg3apzd0T8hNKHy4sFrJIbSdnLtvtm-HM,24240
|
64
64
|
tequila/simulators/simulator_qibo.py,sha256=evOGd_-uyUQaQu60K02KIIqtTqjn1jW6XS9ux2TsC9M,25095
|
65
65
|
tequila/simulators/simulator_qiskit.py,sha256=KZhyvbziCEOx-oO5bfyZlU0cEBkZNW1uvuHLPkVNrJo,23429
|
@@ -79,8 +79,8 @@ tequila/utils/keymap.py,sha256=RgQzeHEfRVee0-uoH-QsLYsGsXyMhEp3n33KCH-EV2k,3735
|
|
79
79
|
tequila/utils/misc.py,sha256=e62ASkFReaLJQXnBXzyYukzXZnXNoURsM1luoMeIXiE,919
|
80
80
|
tequila/wavefunction/__init__.py,sha256=q4DVL0lGFg03PogRMYA6S8MQqqmLYQiU9VNOF-YQxfQ,50
|
81
81
|
tequila/wavefunction/qubit_wavefunction.py,sha256=16Y9vRj6Yc6sBAKRUHVXJG4lJLDjWyN1b5fugf2LAmI,11881
|
82
|
-
tequila_basic-1.
|
83
|
-
tequila_basic-1.
|
84
|
-
tequila_basic-1.
|
85
|
-
tequila_basic-1.
|
86
|
-
tequila_basic-1.
|
82
|
+
tequila_basic-1.9.1.dist-info/LICENSE,sha256=oG1FtUav5_xrym9ByiG5emJDQRcbnAfTB08fRV9TCiE,1114
|
83
|
+
tequila_basic-1.9.1.dist-info/METADATA,sha256=T_Um6-6ZQ9139PZ718W89V3XSY4tMdDv3mqaw--X730,19293
|
84
|
+
tequila_basic-1.9.1.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
85
|
+
tequila_basic-1.9.1.dist-info/top_level.txt,sha256=VBH0gl6mDMbcLHKlO0yEAqtcq08DqBHz4gRJ9jafl5w,8
|
86
|
+
tequila_basic-1.9.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|