Homomorphic Translator¶
The HomomorphicTranslator implements translation
rules for Quantum Homomorphic Encryption (QHE) based
blind quantum computation.
Overview¶
This translator converts standard quantum gates into their encrypted delegated equivalents using recursive decryption and conditional correction techniques.
The implementation follows approaches from:
Childs (2005)
Broadbent and Jeffery (2015)
Fisher et al. (2014)
Tan et al. (2017)
Joshi et al. (2025)
Supported Gates¶
The translator supports:
HSS†TT†CXCZCCXarbitrary
Rz
Recursive Decryption¶
Arbitrary Rz rotations are implemented using
recursive decryption techniques.
This enables:
efficient parametric delegation
variational quantum circuits
low-depth blind transpilation
Applications¶
This translator is suitable for:
quantum homomorphic encryption
variational quantum algorithms
parametric circuit delegation
delegated secure quantum simulation
Module Documentation¶
- class blind_transpiler.translators.homomorphicTranslator.HomomorphicTranslation[source]¶
Bases:
BaseTranslator- ccx(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘t’ gate for qhe. Needed size of encryption key = 18 (Need hidden conditionals for decryption: 1 CZ and 2 CX = 6 + 1*4 + 2*4 = 18)
- Parameters:
key – list[int] contains randomly generated binary keys, each element can be 0 or 1.
qargs – list[int] contains the argument on which the key has to be applied.
gate_seq – int used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
Tuple[BOP] tuple of BOP class object sequence needed for encryption, compute and decryption of the ‘t’ gate.
- Raises:
None –
- Library Dependency:
qiksit.circuit.library - XGate, ZGate math - pi
- cx(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘cx’ gate for qhe. Needed size of encryption key = 4
- Parameters:
key – list[int] contains randomly generated binary keys, each element can be 0 or 1.
qargs – list[int] contains the argument on which the key has to be applied.
gate_seq – int used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
Tuple[BOP] tuple of BOP class object sequence needed for encryption, compute and decryption of the ‘cx’ gate.
- Raises:
None –
- Library Dependency:
qiksit.circuit.library XGate, ZGate math - pi
- cz(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘cz’ gate for qhe. Needed size of encryption key = 4
- Parameters:
key – list[int] contains randomly generated binary keys, each element can be 0 or 1.
qargs – list[int] contains the argument on which the key has to be applied.
gate_seq – int used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
Tuple[BOP] tuple of BOP class object sequence needed for encryption, compute and decryption of the ‘cz’ gate.
- Raises:
None –
- Library Dependency:
qiksit.circuit.library - XGate, ZGate math - pi
- h(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘h’ gate for qhe. Needed size of encryption key = 2
- Parameters:
key (list[int]) – contains randomly generated binary keys, each element can be 0 or 1.
qargs (list[int]) – contains the argument on which the key has to be applied.
gate_seq (int) – used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
tuple of BOP class object sequence needed for encryption, compute and decryption of the h gate.
- Return type:
Tuple[BOP]
- Raises:
None –
- Library Dependency:
- qiksit.circuit.library:
XGate, ZGate, HGate
- rz(theta, key, qargs, gate_seq)[source]¶
Encryption and Decryption logic for ‘rz’ gate of qhe. (Can’t handle different keys for all the gates rightnow.) Decomposes the theta in integral power of series = a*pi + b*pi/2 + c*pi/4 + d*pi/8 + e*pi/16 + ….. (default= 20 precision points) approximatedly equal to theta, if theta is not integer power of pi/4, using function ‘_rz_integral’ Logic of the function:
Case 1: exact expansion for n*pi/4 if n is integer.
Case 2: approximate expansion if n is not integer.
- Parameters:
theta – float contain the theta parameter (in radian) to apply theta rotation on the circuit.
key – list[int] contains randomly generated binary keys, each element can be 0 or 1.
qargs – list[int] contains the argument on which the key has to be applied.
gate_seq – int used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
Tuple[BOP] tuple of BOP class object sequence needed for encryption, compute and decryption of the s gate. Here as the circuit was of variable length, we have used recursive_roll to revert the output.
- Raises:
None –
- Library Dependency:
qiksit.circuit.library XGate, ZGate, RZGate math pi
- s(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘s’ gate for qhe. Needed size of encryption key = 2
- Parameters:
key (list[int]) – contains randomly generated binary keys, each element can be 0 or 1.
qargs (list[int]) – contains the argument on which the key has to be applied.
gate_seq (int) – used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
tuple of BOP class object sequence needed for encryption, compute and decryption of the s gate.
- Return type:
Tuple[BOP]
- Raises:
None –
- Library Dependency:
- qiksit.circuit.library:
XGate, ZGate, RZGate
- math:
pi
- sdg(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘sdg’ gate for qhe. Needed size of encryption key = 2
- Parameters:
key (list[int]) – contains randomly generated binary keys, each element can be 0 or 1.
qargs (list[int]) – contains the argument on which the key has to be applied.
gate_seq (int) – used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
tuple of BOP class object sequence needed for encryption, compute and decryption of the sdg gate.
- Return type:
Tuple[BOP]
- Raises:
None –
- Library Dependency:
- qiksit.circuit.library:
XGate, ZGate, RZGate
- math:
pi
- t(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘t’ gate for qhe. Needed size of encryption key = 4
- Parameters:
key (list[int]) – contains randomly generated binary keys, each element can be 0 or 1.
qargs (list[int]) – contains the argument on which the key has to be applied.
gate_seq (int) – used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
tuple of BOP class object sequence needed for encryption, compute and decryption of the ‘t’ gate.
- Return type:
Tuple[BOP]
- Raises:
None –
- Library Dependency:
- qiksit.circuit.library:
XGate, ZGate, RZGate
- math:
pi
- tdg(key, qargs, gate_seq)[source]¶
Encryption and decryption logic of ‘t’ gate for qhe. Needed size of encryption key = 4
- Parameters:
key (list[int]) – contains randomly generated binary keys, each element can be 0 or 1.
qargs (list[int]) – contains the argument on which the key has to be applied.
gate_seq (int) – used to store the information of which gate from original circuit, this translation is coming from.
- Returns:
tuple of BOP class object sequence needed for encryption, compute and decryption of the ‘t’ gate.
- Return type:
Tuple[BOP]
- Raises:
None –
- Library Dependency:
- qiksit.circuit.library:
XGate, ZGate, RZGate
- math:
pi