Error implementing circuit on X8 machine

Hi there. I am trying to implement the following program on the X8 machine.

        s_abt=[1.9767559336493115, 4.758100468213858, 1.369620673054872, 
        1.8880582939476536, 6.419177455135756, 3.2882821050599693, 3.8345158683757177, 
        3.1152414521825516, 4.138611213886801, 5.234497111722375, 1.2591843035031594, 
        3.032897347227236]
        circuit1 = sf.Program(8)
        with circuit1.context as q:
            S2gate(1.0) | (q[0], q[4])
            S2gate(1.0) | (q[1], q[5])
            S2gate(1.0) | (q[2], q[6])
            S2gate(1.0) | (q[3], q[7])
            
            MZgate(s_abt[0], s_abt[1]) | (q[0], q[1])
            MZgate(s_abt[2], s_abt[3]) | (q[2], q[3])
            MZgate(s_abt[4], s_abt[5]) | (q[1], q[2])

            MZgate(s_abt[6], s_abt[7]) | (q[0], q[1])
            MZgate(s_abt[8], s_abt[9]) | (q[2], q[3])
            MZgate(s_abt[10], s_abt[11]) | (q[1], q[2])

            MZgate(s_abt[0], s_abt[1]) | (q[4], q[5])
            MZgate(s_abt[2], s_abt[3]) | (q[6], q[7])
            MZgate(s_abt[4], s_abt[5]) | (q[5], q[6])

            MZgate(s_abt[6], s_abt[7]) | (q[4], q[5])
            MZgate(s_abt[8], s_abt[9]) | (q[6], q[7])
            MZgate(s_abt[10], s_abt[11]) | (q[5], q[6])
            MeasureFock() | q
        
        eng = sf.RemoteEngine("X8_01")
        circuit1.compile(device=eng.device, compiler="Xunitary")
        circuit1.print()
        results = eng.run(circuit1, shots=n_samples, disable_port_permutation=True)

The above program does not run on the real machine, even though I can implement it in simulation. I have tried to run it a lot of times with no success.

S2gate(1, 0) | (q[0], q[4])
S2gate(1, 0) | (q[1], q[5])
S2gate(1, 0) | (q[2], q[6])
S2gate(1, 0) | (q[3], q[7])
MZgate(1.977, 4.758) | (q[0], q[1])
MZgate(1.37, 1.888) | (q[2], q[3])
MZgate(6.419, 3.288) | (q[1], q[2])
MZgate(3.835, 3.115) | (q[0], q[1])
MZgate(4.139, 5.234) | (q[2], q[3])
MZgate(1.259, 3.033) | (q[1], q[2])
MZgate(1.977, 4.758) | (q[4], q[5])
MZgate(1.37, 1.888) | (q[6], q[7])
MZgate(6.419, 3.288) | (q[5], q[6])
MZgate(3.835, 3.115) | (q[4], q[5])
MZgate(4.139, 5.234) | (q[6], q[7])
MZgate(1.259, 3.033) | (q[5], q[6])
MeasureFock | (q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7])
2023-08-16 13:38:06,808 - INFO - Compiling program for device X8_01 using compiler Xunitary.
2023-08-16 13:38:33,081 - ERROR - The remote job 390461a6-0c89-4aee-b397-3fb7d51f1951 failed due to an internal server error: {'error-code': 'bad-parameters-for-QPU', 'error-detail': 'The requested unitary and squeezing amplitudes could not be implemented on the quantum processing unit. If this error persists after multiple attempts, please contact technical support for possible solutions.'}. Please try again.

I am using the following packages -
numpy 1.23.5
StrawberryFields 0.23.0

Thank you for your help.

Hello @Aditya_Ranjan,

Some details from Executing programs on X8 devices — Strawberry Fields

Executing Jobs examples use a different approach to ops.MeasureFock()

Your S2gate appears to have correct parameters, but double check (r=1, phi=0) and (r=0, phi=0)

Hi @Aditya_Ranjan,

As @kevinkawchak noted the error message that you’re getting is telling you that something is wrong with the parameters. I don’t think it’s in the squeezing or the measurement but I may be wrong.

My recommendation would be to try some of the examples on the X8 tutorial and modify it little by little until you understand which parameters are causing the issues.

Please let us know if you still have the error with the original tutorial programs or if you still cannot figure out the wrong parameter after changing line by line.

I hope this helps!

1 Like