A circuit for transferring power from a direct current, DC, line to an alternating current, AC, line (241-1 to 241-P, 341-342, 341-H to 342-H, 441-443, 471-473, 541-542) configured to receive two or more AC phases, the circuit comprising: a polarity-matching circuit comprising: two or more switches (231-1 to 231-P, 331-332, 431-433) coupled to the DC line (204, 304), wherein each of the two or more switches is individually coupled to one respective phase of the two or more AC phases on the AC line; an AC neutral line (206, 306); and wherein: the DC line comprises a first side (304 or 305) and a second side (305 or 304), wherein the first side is high relative to the second side; and the first side or the second side is directly coupled to the AC neutral line (205/206, 305/306); and a control block coupled to each of the two or more of switches; and wherein: the control block is configured to control the two or more switches such that no more than one switch, of the two or more switches (231-1 to-231-P) is closed when power is being transferred to the AC line from the DC line; and the control block is configured to couple each of the two or more switches selectively to the AC line such that the DC line communicates shaped DC current to a fixed polarity of positive or negative, but not both, of the AC phases on the AC line only when a polarity of the phase is in a same direction as a polarity of the DC line. two or more switches (231-1 to 231-P, 331-332, 431-433) coupled to the DC line (204, 304), wherein each of the two or more switches is individually coupled to one respective phase of the two or more AC phases on the AC line; an AC neutral line (206, 306); and wherein: the DC line comprises a first side (304 or 305) and a second side (305 or 304), wherein the first side is high relative to the second side; and the first side or the second side is directly coupled to the AC neutral line (205/206, 305/306); and the DC line comprises a first side (304 or 305) and a second side (305 or 304), wherein the first side is high relative to the second side; and the first side or the second side is directly coupled to the AC neutral line (205/206, 305/306); and a control block coupled to each of the two or more of switches; and wherein: the control block is configured to control the two or more switches such that no more than one switch, of the two or more switches (231-1 to-231-P) is closed when power is being transferred to the AC line from the DC line; and the control block is configured to couple each of the two or more switches selectively to the AC line such that the DC line communicates shaped DC current to a fixed polarity of positive or negative, but not both, of the AC phases on the AC line only when a polarity of the phase is in a same direction as a polarity of the DC line. the control block is configured to control the two or more switches such that no more than one switch, of the two or more switches (231-1 to-231-P) is closed when power is being transferred to the AC line from the DC line; and the control block is configured to couple each of the two or more switches selectively to the AC line such that the DC line communicates shaped DC current to a fixed polarity of positive or negative, but not both, of the AC phases on the AC line only when a polarity of the phase is in a same direction as a polarity of the DC line.