qrisp.grover.tag_state#
- tag_state(*args, permeability='args', is_qfree=True, verify=False, **kwargs)#
Applies a phase tag to (multiple) QuantumVariables. The tagged state is specified in the dictionary
tag_specificator
. This dictionary should contain the QuantumVariables as keys and the labels of the states which should be tagged as values.- Parameters:
- tag_specificatordict
A dictionary specifying which state should be tagged.
- binary_valuesbool, optional
If set to True, the values in the tag_specificator dict have to be bitstrings instead of labels. The default is False.
- phasefloat or sympy.Symbol, optional
Specify the phase shift the tag should perform. The default is pi, i.e. a multi-controlled Z gate.
Examples
We construct an oracle that tags the states -3 and 2 on two QuantumFloats
from qrisp.grover import tag_state def test_oracle(qf_list): tag_dic = {qf_list[0] : -3, qf_list[1] : 2} tag_state(tag_dic)